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
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).