google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
7.47k stars 734 forks source link

How to set free joint in keyframe #1718

Closed LIUHAITAO-CH closed 1 week ago

LIUHAITAO-CH commented 3 weeks ago

Hi,

I'm a student and I'm trying to use MuJoCo for building mobile manipulator.

I'm looking for some help with keyframe and free joint.

If I have a free joint and a couple of other rotating joints. In the key tag, the first seven elements in qpos correspond to the free joint, the first three positions, and the last four quaternions, right?

What does ctrl mean in the key tag, and why does free joint correspond to 6 elements instead of 7 ?

  <keyframe>
    <key name="home1" qpos="-2.96778 -1.17666 0 1 0 0 0      0 0 0 -1.57079 0 1.57079 0 0 0" ctrl="-2.96778 -1.17666 0 0 0 0     0 0 0 -1.57079 0 1.57079 0 0 0" />
  </keyframe>

After I set it up, I clicked the key in mujoco.app. Why did the robot jump? Here is a gif , illustrating my question: Jun-04-2024 21-16-50

thanks for your help, @yuvaltassa

LilianLaporte commented 2 weeks ago

It seems that it jumps because the wheels are under the floor. So when it wants the go back onto the floor, it jumps because of the vertical velocity.