<mujoco model="xarm_gripper">
    <compiler angle="radian" />
    <size njmax="500" nconmax="100" />
    <asset>
        <mesh name="base_link" file="base_link.STL" />
        <mesh name="left_outer_knuckle" file="left_outer_knuckle.STL" />
        <mesh name="left_finger" file="left_finger.STL" />
        <mesh name="left_inner_knuckle" file="left_inner_knuckle.STL" />
        <mesh name="right_outer_knuckle" file="right_outer_knuckle.STL" />
        <mesh name="right_finger" file="right_finger.STL" />
        <mesh name="right_inner_knuckle" file="right_inner_knuckle.STL" />
    </asset>

    Copied from panda, expanding to 6 joints
    <position ctrllimited="true" ctrlrange="0 0.85" joint="drive_joint" kp="1000000" name="gripper_drive_joint" forcelimited="true" forcerange="-20 20"/>
    <position ctrllimited="true" ctrlrange="0 0.85" joint="left_finger_joint" kp="1000000" name="gripper_left_finger_joint" forcelimited="true" forcerange="-20 20"/>
    <position ctrllimited="true" ctrlrange="0 0.85" joint="left_inner_knuckle_joint" kp="1000000" name="gripper_left_inner_knuckle_joint" forcelimited="true" forcerange="-20 20"/>
    <position ctrllimited="true" ctrlrange="0 0.85" joint="right_outer_knuckle_joint" kp="1000000" name="gripper_right_outer_knuckle_joint" forcelimited="true" forcerange="-20 20"/>
    <position ctrllimited="true" ctrlrange="0 0.85" joint="right_finger_joint" kp="1000000" name="gripper_right_finger_joint" forcelimited="true" forcerange="-20 20"/>
    <position ctrllimited="true" ctrlrange="0 0.85" joint="right_inner_knuckle_joint" kp="1000000" name="gripper_right_inner_knuckle_joint" forcelimited="true" forcerange="-20 20"/>

    <worldbody>
        <geom type="mesh" rgba="1 1 1 1" mesh="base_link" />
        <body name="left_outer_knuckle" pos="0 0.035 0.059098">
            <inertial pos="0 0.021559 0.015181" quat="0.47789 0.87842 0 0" mass="0.033618" diaginertia="1.9111e-05 1.79089e-05 1.90167e-06" />
            <joint name="drive_joint" pos="0 0 0" axis="1 0 0" limited="true" range="0 0.85" />
            <geom type="mesh" rgba="0.753 0.753 0.753 1" mesh="left_outer_knuckle" />
            <body name="left_finger" pos="0 0.035465 0.042039">
                <inertial pos="0 -0.016413 0.029258" quat="0.697634 0.115353 -0.115353 0.697634" mass="0.048304" diaginertia="1.88037e-05 1.7493e-05 3.56792e-06" />
                <joint name="left_finger_joint" pos="0 0 0" axis="-1 0 0" limited="true" range="0 0.85" />
                <geom type="mesh" rgba="0.753 0.753 0.753 1" mesh="left_finger" />
            </body>
        </body>
        <body name="left_inner_knuckle" pos="0 0.02 0.074098">
            <inertial pos="1.86601e-06 0.0220468 0.0261335" quat="0.664139 -0.242732 0.242713 0.664146" mass="0.0230126" diaginertia="8.34216e-06 6.0949e-06 2.75601e-06" />
            <joint name="left_inner_knuckle_joint" pos="0 0 0" axis="1 0 0" limited="true" range="0 0.85" />
            <geom type="mesh" rgba="0.753 0.753 0.753 1" mesh="left_inner_knuckle" />
        </body>
        <body name="right_outer_knuckle" pos="0 -0.035 0.059098">
            <inertial pos="0 -0.021559 0.015181" quat="0.87842 0.47789 0 0" mass="0.033618" diaginertia="1.9111e-05 1.79089e-05 1.90167e-06" />
            <joint name="right_outer_knuckle_joint" pos="0 0 0" axis="-1 0 0" limited="true" range="0 0.85" />
            <geom type="mesh" rgba="0.753 0.753 0.753 1" mesh="right_outer_knuckle" />
            <body name="right_finger" pos="0 -0.035465 0.042039">
                <inertial pos="0 0.016413 0.029258" quat="0.697634 -0.115356 0.115356 0.697634" mass="0.048304" diaginertia="1.88038e-05 1.7493e-05 3.56779e-06" />
                <joint name="right_finger_joint" pos="0 0 0" axis="1 0 0" limited="true" range="0 0.85" />
                <geom type="mesh" rgba="0.753 0.753 0.753 1" mesh="right_finger" />
            </body>
        </body>
        <body name="right_inner_knuckle" pos="0 -0.02 0.074098">
            <inertial pos="1.866e-06 -0.022047 0.026133" quat="0.66415 0.242702 -0.242721 0.664144" mass="0.023013" diaginertia="8.34209e-06 6.0949e-06 2.75601e-06" />
            <joint name="right_inner_knuckle_joint" pos="0 0 0" axis="-1 0 0" limited="true" range="0 0.85" />
            <geom type="mesh" rgba="0.753 0.753 0.753 1" mesh="right_inner_knuckle" />
        </body>
    </worldbody>
</mujoco>
