I want to control the ball joint in quaternion space with motor. I made xml somthing like following. <worldbody> <bodyname="robotworld" pos="1.00 -0.162 1.2" euler="0 0 0"> <bodyname="robotwrist_rolllink" pos="0 0 0" quat="0 0 0 1"> <jointname="wrist_ball_joint" type="ball" pos="0.01 2.7 -0.06"/> </body> </body> </worldbody> <actuator> <motor ctrlrange="-2.0 2.0" gear="7.0" joint="wrist_ball_joint"/> </actuator> When I run this on Mujoco2.0 simulator, I only have one control tab to change, and when I bring this tab forward, my wrist start rotating in random direction. How I can command the torque (or position) command to actually control the orientation of this joint ? Or is the ball joint is meant for passive behavior? Thanks,
The "gear" attribute for ball joint actuators is a 3D vector specifying an axis of rotation. To actually the ball joint fully, you need to attach 3 actuators to it with orthogonal axes. The simplest choice of axes is "1 0 0", "0 1 0", "0 0 1". See gear description here: http://www.mujoco.org/book/XMLreference.html#general