How do I set the joint limits for 3 hinge joints?

Hi,

It seems that the body geometry and/or joint limits defined in the mjcf file influence the pd-controller.

I have a body with 3 hinge joints with joint limits. As far as I know they are converted to a spherical joint.
What is the meaning of the lower and upper joint limit of each joint in this case?

My robot description is:

<mujoco model="leg">
    <compiler angle="radian"/>
    <worldbody>
            <body name="hip" pos="0.0 -0.1 0.0">
                <geom density="10" pos="0.0 -0.2 0.0" quat="0.707 0.707 0 0" size="0.05 0.15" type="capsule"/>
                <body name="knee" pos="0.0 -0.35 0.0">
                    <joint name="knee_x" axis="1 0 0" range="-0.04 2.0" stiffness="500" damping="50" limited="true" type="hinge"/>
                    <joint name="knee_y" axis="0 1 0" range="-2.0 2.0" stiffness="500" damping="50" limited="true" type="hinge"/>
                    <joint name="knee_z" axis="0 0 1" range="-0.04 0.04" stiffness="500" damping="50" limited="true" type="hinge"/>
                    <geom density="10" pos="0.0 -0.2 0.0" quat="0.6977905 0.7163019 0 0" size="0.05 0.15" type="capsule"/>
                </body>
            </body>
    </worldbody>
</mujoco>
  1. I use the joint_monkey.py file to load this asset and comment the code that drives the joints to there limit.
  2. In the Isaac Gym visualization I manually set the Drive modes of each DOF knee_* to Position Target. Now the set position targets are 0.0000 for all three dofs.
  3. Now I move the slider of knee_x from 0 up to 2.0
    • “State → Position” of knee_x is only at 1.7
    • “State → Position” of knee_y is at -0.74 (despite having not moved the slider of the y dof.
    • also visually the geometry rotated not only around the x axis as I would expect

When I change for instance the orientation of the knee geometry to quat="0.707 0.707 0 0" this does not happen and it only rotates around the x axis. When changing the size to size="0.05 0.14" the “State → Position” ends up differently. When changing all joint limits to -2.0 2.0 the “State → Position” of knee_y stays at 0 but instead the “State → Position” of knee_z is changing.

Can you reproduce this? How can I mitigate this behavior?

Thank you for the support!