set position the body with freejoint

Discussion in 'Simulation' started by foolyc, Dec 13, 2017.

  1. I use mujoco_py(mujoco 150). Does any one know how to dynamically set the position of a body with freejoint?

    sim.data.body_pos = ? only works for body without freejoint
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    All joints are included in the system vector qpos. So you just need to know the location of your joint. Free joints have 7 numbers: 3D position followed by 4D unit quaternion. Presumably mujoco_py gives you access to qpos (although I don't use it so I can't comment on the specifics).
     
    Kyokushin likes this.
  3. Thank you!