CoM task#

The CoMTask is a task that can be used to impose a target position for the center of mass in the world.

Note

Because every body contributes to the center of mass, this task can have unexpected behaviors when used on under-constrained formulations. We encourage you using a regularization task in conjunction with this task.

Task initialization#

The CoM task can be initialized by calling add_com_task() on the solver:

# Initialize the CoM task
com_task = solver.add_com_task(np.array([0., 0., 0.3]))
com_task.configure("com", "soft", 1.0)

Update the task#

The task can be updated by setting target_world:

# Update the target position
com_task.target_world = np.array([0., 0., 0.3])

Example#

The CoM task is used in the following example to swing the robot body laterally: