<mujocoinclude>
    <option collision="all" timestep="0.001" gravity="0 0 -9.81" cone="elliptic" />
    <compiler angle="radian" />

    <asset>
        <mesh name="link0_collision"  file="meshes/collision/link0.stl"  scale="1 1 1" />
        <mesh name="link1_collision"  file="meshes/collision/link1.stl"  scale="1 1 1" />
        <mesh name="link2_collision"  file="meshes/collision/link2.stl"  scale="1 1 1" />
        <mesh name="link3_collision"  file="meshes/collision/link3.stl"  scale="1 1 1" />
        <mesh name="link4_collision"  file="meshes/collision/link4.stl"  scale="1 1 1" />
        <mesh name="link5_collision"  file="meshes/collision/link5.stl"  scale="1 1 1" />
        <mesh name="link6_collision"  file="meshes/collision/link6.stl"  scale="1 1 1" />
        <mesh name="link7_collision"  file="meshes/collision/link7.stl"  scale="1 1 1" />
        <mesh name="hand_collision"   file="meshes/collision/hand.stl"   scale="1 1 1" />
        <mesh name="finger_collision" file="meshes/collision/finger.stl" scale="1 1 1" />

        <mesh name="link0_visual"  file="meshes/visual/link0.stl"  scale="1 1 1" />
        <mesh name="link1_visual"  file="meshes/visual/link1.stl"  scale="1 1 1" />
        <mesh name="link2_visual"  file="meshes/visual/link2.stl"  scale="1 1 1" />
        <mesh name="link3_visual"  file="meshes/visual/link3.stl"  scale="1 1 1" />
        <mesh name="link4_visual"  file="meshes/visual/link4.stl"  scale="1 1 1" />
        <mesh name="link5_visual"  file="meshes/visual/link5.stl"  scale="1 1 1" />
        <mesh name="link6_visual"  file="meshes/visual/link6.stl"  scale="1 1 1" />
        <mesh name="link7_visual"  file="meshes/visual/link7.stl"  scale="1 1 1" />
        <mesh name="hand_visual"   file="meshes/visual/hand.stl"   scale="1 1 1" />
        <mesh name="finger_visual" file="meshes/visual/finger.stl" scale="1 1 1" />
    </asset>

    <default>
        <default class="panda">
            <joint pos="0 0 0" axis="0 0 1" limited="true" damping="0.003" />
            <default class="visual">
                <geom contype="0" conaffinity="0" group="0" type="mesh" rgba=".95 .99 .92 1" mass="0" />
            </default>

            <default class="collision">
                <geom contype="1" conaffinity="1" group="3" type="mesh" rgba=".5 .6 .7 1" />
            </default>
            <default class="panda_finger">
                <joint damping="0.03" />
            </default>
        </default>
    </default>

    <asset>
        <texture builtin="checker" height="512" name="texplane" rgb1=".2 .3 .4" rgb2=".1 .15 .2" type="2d" width="512" />
        <material name="MatPlane" reflectance="0.5" shininess="0.01" specular="0.1" texrepeat="1 1" texture="texplane" texuniform="true" />
    </asset>

    <worldbody>
        <light pos="0 0 1000" castshadow="false" />
        <geom name="ground_plane" type="plane" size="5 5 10" material="MatPlane" rgba="1 1 1 1"/>

        <body name="panda_link0" childclass="panda">
            <inertial pos="-0.041018 -0.00014 0.049974" mass="0.629769" fullinertia="0.00315 0.00388 0.004285 8.2904E-07 0.00015 8.2299E-06" />
            <geom class="visual"    mesh="link0_visual" />
            <geom class="collision" mesh="link0_collision" />

            <body name="panda_link1" pos="0 0 0.333">
                <inertial pos="3.875e-03 2.081e-03 -4.762e-02" mass="4.970684" fullinertia="7.0337e-01 7.0661e-01 9.1170e-03 -1.3900e-04 6.7720e-03 1.9169e-02" />
                <joint name="panda_joint1" range="-2.9671 2.9671" />
                <geom class="visual"    mesh="link1_visual" />
                <geom class="collision" mesh="link1_collision" />

                <body name="panda_link2" pos="0 0 0" quat="0.707107 -0.707107 0 0">
                    <inertial pos="-3.141e-03 -2.872e-02  3.495e-03" mass="0.646926" fullinertia="7.9620e-03 2.8110e-02 2.5995e-02 -3.9250e-03 1.0254e-02 7.0400e-04" />
                    <joint name="panda_joint2" range="-1.8326 1.8326" />
                    <geom class="visual"    mesh="link2_visual" />
                    <geom class="collision" mesh="link2_collision" />

                    <body name="panda_link3" pos="0 -0.316 0" quat="0.707107 0.707107 0 0" >
                        <inertial pos="2.7518e-02 3.9252e-02 -6.6502e-02" mass="3.228604" fullinertia="3.7242e-02 3.6155e-02 1.0830e-02 -4.7610e-03 -1.1396e-02 -1.2805e-02" />
                        <joint name="panda_joint3" range="-2.9671 2.9671" />
                        <geom class="visual"    mesh="link3_visual" />
                        <geom class="collision" mesh="link3_collision" />

                        <body name="panda_link4" pos="0.0825 0 0" quat="0.707107 0.707107 0 0">
                            <inertial pos="-5.317e-02 1.04419e-01 2.7454e-02" mass="3.587895" fullinertia="2.5853e-02 1.9552e-02 2.8323e-02 7.7960e-03 -1.3320e-03 8.6410e-03" />
                            <joint name="panda_joint4" range="-3.1416 -0.4" />
                            <geom class="visual"    mesh="link4_visual" />
                            <geom class="collision" mesh="link4_collision" />

                            <body name="panda_link5" pos="-0.0825 0.384 0" quat="0.707107 -0.707107 0 0" >
                                <inertial pos="-1.1953e-02 4.1065e-02 -3.8437e-02" mass="1.225946" fullinertia="3.5549e-02 2.9474e-02 8.6270e-03 -2.1170e-03 -4.0370e-03 2.2900e-04" />
                                <joint name="panda_joint5" range="-2.9671 2.9671" />
                                <geom class="visual"    mesh="link5_visual" />
                                <geom class="collision" mesh="link5_collision" />

                                <body name="panda_link6" pos="0 0 0" quat="0.707107 0.707107 0 0" >
                                    <inertial pos="6.0149e-02 -1.4117e-02 -1.0517e-02" mass="1.666555" fullinertia="1.9640e-03 4.3540e-03 5.4330e-03 1.0900e-04 -1.1580e-03 3.4100e-04" />
                                    <joint name="panda_joint6" range="-0.0873 3.8223" />
                                    <geom class="visual"    mesh="link6_visual" />
                                    <geom class="collision" mesh="link6_collision" />

                                    <body name="panda_link7" pos="0.088 0 0" quat="0.707107 0.707107 0 0" >
                                        <inertial pos="1.0517e-02 -4.252e-03 6.1597e-02" mass="7.35522e-01" fullinertia="1.2516e-02 1.0027e-02 4.8150e-03 -4.2800e-04 -1.1960e-03 -7.4100e-04" />
                                        <joint name="panda_joint7" range="-2.9671 2.9671" />
                                        <geom class="visual"    mesh="link7_visual" />
                                        <geom class="collision" mesh="link7_collision" />

                                        <site name='ee_site' pos='0 0 0.107' size="0.005, 0.005, 0.005" euler='0 0 -1.57'/>

                                        <body name="panda_hand" pos="0 0 0.107" quat="0.924  0.0  0.0 -0.383">
                                            <inertial pos="-0.01 0 0.03" mass="0.73" diaginertia="0.001 0.0025 0.0017" />
                                            <geom class="visual"    mesh="hand_visual" />
                                            <geom class="collision" mesh="hand_collision" />

                                            <body name="panda_leftfinger" pos="0 0 0.0584" >
                                                <joint name="panda_finger_joint1" axis="0 1 0" type="slide" range="0 0.04" />
                                                <geom class="visual"    mesh="finger_visual" />
                                                <geom class="collision" mesh="finger_collision" />
                                            </body>

                                            <body name="panda_rightfinger" pos="0 0 0.0584">
                                                <joint name="panda_finger_joint2" axis="0 -1 0" type="slide" range="0 0.04" />
                                                <geom class="visual"    quat="0 0 0 1" mesh="finger_visual" />
                                                <geom class="collision" quat="0 0 0 1" mesh="finger_collision" />
                                            </body>
                                        </body>
                                    </body>
                                </body>
                            </body>
                        </body>
                    </body>
                </body>
            </body>
        </body>
    </worldbody>
    <contact>
        <exclude body1="panda_link0" body2="panda_link1" />
        <exclude body1="panda_link0" body2="panda_link2" />
        <exclude body1="panda_link0" body2="panda_link3" />
        <exclude body1="panda_link0" body2="panda_link4" />

        <exclude body1="panda_link1" body2="panda_link2" />
        <exclude body1="panda_link1" body2="panda_link4" />

        <exclude body1="panda_link2" body2="panda_link3" />
        <exclude body1="panda_link2" body2="panda_link4" />

        <exclude body1="panda_link3" body2="panda_link4" />
        <exclude body1="panda_link3" body2="panda_link6" />

        <exclude body1="panda_link4" body2="panda_link5" />
        <exclude body1="panda_link4" body2="panda_link6" />
        <exclude body1="panda_link4" body2="panda_link7" />
        <exclude body1="panda_link4" body2="panda_hand" />

        <exclude body1="panda_link5" body2="panda_link7" />

        <exclude body1="panda_link6" body2="panda_link7" />

        <exclude body1="panda_link7" body2="panda_hand" />
    </contact>


    <sensor>
        <force name="ee_force_sensor" site="ee_site"/>
        <torque name="ee_torque_sensor" site="ee_site"/>
    </sensor>
</mujocoinclude>
