Axis-align task#

The AxisAlignTask aligns an axis expressed in a robot frame to another axis expressed in the world.

Creating the task#

The axis align task can be created by calling add_axisalign_task() on the solver:

# Aligns the camera z-axis with the world x-axis
axisalign_task = solver.add_axisalign_task("camera", np.array([0., 0., 1.]), np.array([1., 0., 0.]))
axisalign_task.configure("look_at", "soft", 1.0)

Updating the task#

The target axis can be updated by setting the targetAxis_world:

# Update the task so that the world axis match the camera to ball vector
axisalign_task.targetAxis_world = ball - camera_pos

Example#

In the following example, an humanoid robot is looking at a ball by using the axis align task: