Camera Pos/Quat <----> Pose

Discussion in 'Visualization' started by Luis Piloto, May 16, 2017.

  1. In the model XML files, cameras are defined with a position in the worldbody and a rotation attribute such as quat or axisangle. However, mjvCamera uses Pose (lookat, distance, azimuth, elevation). Is there a mujoco function, or other method, for converting back and forth between pos/quat and pose?
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    The conversion is done internally, but there is no utility function that you can call directly. You can do the math yourself, it involves a bunch of sin and cos functions. Actually the camera pose (lookat, distance, azimuth, elevation) can only encode a subset of possible body poses, because the camera cannot twist around the gaze axis. So the conversion is well-defined only in one direction.