Search code examples
mujoco

MuJoCo. What is the difference between pos, qpos, and xpos?


Can someone give a simple explanation of the difference between these in MuJoCo?

These often come together.


Solution

  • mjModel.foo_pos is the position of a thing in its parent, like the position of a geom in a body. These quantities are fixed and defined the shape of the model (hence, they are in mjModel).

    mjData.qpos are the joint angles. This is the configuration and constitutes half of the mechanical state (the other half being mjData.qvel). Generally any name that starts with q means "in joint space".

    mjData.foo_xpos means Cartesian positions in the global world frame. Again, any name that starts with x means "in global Cartesian space".