<mujoco model="panda_hand">
    <!-- <option timestep="0.01" gravity="0 0 -9.81"/>  not affecting the true value of simulator -->
    <!-- <size njmax="500" nconmax="100" /> -->
    <size njmax="1000" nconmax="200" />
    <asset>
        <mesh name="pad" file="meshes/panda_gripper/pad.stl"  scale="0.001 0.001 0.001"/>  
        <mesh name="finger_vis" file="meshes/panda_gripper/finger_vis_tactile.stl" scale="0.001 0.001 0.001"/>
         <texture type="2d" name="texplane" builtin="checker" rgb1="0.2 0.3 0.4" rgb2="0.1 0.15 0.2" width="512" height="512" />
        <material name="Floor" texture="texplane" />

    </asset>

    <actuator>
        <position ctrllimited="true" ctrlrange="0 0.04" joint="finger_joint1" kp="1000000" name="gripper_joint1" forcelimited="true" forcerange="-20 20"/>
        <!-- <position ctrllimited="true" ctrlrange="-0.04 0" joint="finger_joint2" kp="1000000" name="gripper_joint2" forcelimited="true" forcerange="-20 20"/> -->
    </actuator>

    <worldbody>
    <geom name="floor" size="4 4 0.05" type="plane" material="Floor" pos="0 0 -0.02"/>
        <light pos="1.05 4.16 5.09" dir="0.399601 -0.31968 -0.859141" directional="true" diffuse="0.9 1 0.9" />
        <light pos="4.97 4.53 3.09" dir="-0.419955 0.297468 -0.857409" directional="true" diffuse="1 0.9 0.9" />
      <body name="right_gripper" pos="0 0 0" >

            <!-- <site name="ft_frame" pos="0 0 0" size="0.01 0.01 0.01" rgba="1 0 0 1" type="sphere" group="1"></site> -->

            <inertial pos="0 0 0" quat="0.707107 0.707107 0 0" mass="0.0" diaginertia="0.09 0.07 0.05" />

            <!-- This site was added for visualization. -->
            <!-- <site name="grip_site" pos="0 0 0.1050" size="0.01 0.01 0.01" rgba="1 0 0 1" type="sphere" group="1"/> -->
            <!-- This site was added for visualization. -->
            <!-- <site name="grip_site_cylinder" pos="0 0 0.1399" size="0.005 10" rgba="0 1 0 0.3" type="cylinder" group="1"/> -->

            <body name="leftfinger" pos="0 0 0" quat="0.707107 -0.707107 0 0" >
                <inertial pos="0 0 0" mass="0.1" diaginertia="0.01 0.01 0.005" />
                <joint name="finger_joint1" pos="0 0 0" axis="0 1 0" type="slide" limited="true" range="0.0 0.04" damping="100"/>
                <geom quat="-0.707107 -0.707107 0 0" type="mesh" contype="1" conaffinity="1" group="1" mesh="finger_vis" name="finger1_visual"/>
                <geom quat="-0.707107 -0.707107 0 0" type="mesh" conaffinity="1" contype="1" solref="0.02 1" friction="1 0 0" condim="4" mesh="finger_vis" name="finger1_collision"/>

                <!-- left finger tactile -->
                <body name="touch_l1_body" pos="-0.004 0.0001 0.039" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <site name="touch_l1" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad1" rgba="1 0 0 1"/>  
                </body>

                <body name="touch_l2_body" pos="-0.004 0.0001 0.045" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <site name="touch_l2" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad2" rgba="0 1 0 1"/>
                </body>

                <body name="touch_l3_body" pos="-0.004 0.0001 0.051" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <site name="touch_l3" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad3"/>
                </body>
 
                <body name="touch_l4_body" pos="-0.004 0.0001 0.057" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <site name="touch_l4" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad4"/>
                </body>

                <body name="touch_l5_body" pos="-0.004 0.0001 0.063" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <site name="touch_l5" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad5"/>
                </body>

                <body name="touch_l6_body" pos="0 0.0001 0.042" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <!-- <geom type="box" pos="0.002 -0.0035 0.0536" size=".001 .005 .005" rgba="0 .8 .6 0.5" contype="0" conaffinity="0"/> -->
                <site name="touch_l6" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad6" rgba="0 0 1 1"/>
                </body>

                <body name="touch_l7_body" pos="0 0.0001 0.048" >
                <!-- <joint type="slide" axis="0 1 0"  stiffness="10" damping="0.01"/> -->
                <site name="touch_l7" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad7"/>
                </body>

                <body name="touch_l8_body" pos="0 0.0001 0.054" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <site name="touch_l8" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad8"/>
                </body>

                <body name="touch_l9_body" pos="0 0.0001 0.060" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10"  damping="0.01"/> -->
                <site name="touch_l9" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad9"/>
                </body>

                <body name="touch_l10_body" pos="0 0.0001 0.066" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10"  damping="0.01"/> -->
                <site name="touch_l10" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad10"/>
                </body>

                <body name="touch_l11_body" pos="0.004 0.0001 0.039" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10"  damping="0.01"/> -->
                <site name="touch_l11" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad11"/>
                </body>

                <body name="touch_l12_body" pos="0.004 0.0001 0.045" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <site name="touch_l12" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad12"/>
                </body>

                <body name="touch_l13_body" pos="0.004 0.0001 0.051" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <site name="touch_l13" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad13"/>
                </body>

                <body name="touch_l14_body" pos="0.004 0.0001 0.057" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <site name="touch_l14" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad14"/>
                </body>

                <body name="touch_l15_body" pos="0.004 0.0001 0.063" >
                <!-- <joint type="slide" axis="0 1 0" stiffness="10" damping="0.01"/> -->
                <site name="touch_l15" type="cylinder" pos="0 -0.0001 0" size="0.002 0.0007" euler="1.5708 0 0" rgba="0 0.5 0.5 0.33"/>
                <geom type= "cylinder" size="0.002 0.0007" euler="1.5708 0 0" contype="1" conaffinity="1" group="1" name="lpad15"/>
                </body>

                <!-- <body name="finger_joint1_tip" pos="-0.00028 0.008 0.0685">
                    <inertial pos="0 0 0" quat="0 0 0 1" mass="0.01" diaginertia="0.01 0.01 0.01" />
                    <geom size="0.009 0.0036 0.0175" pos="0 -0.005 -0.015" quat="0 0 0 1" type="box" solref="0.01 0.5" friction = "1 0 0" conaffinity="1" contype="1" name="finger1_tip_collision"/> -->

                <body name="finger_joint1_tip" pos="0.0 0.008 0.0685">
                    <inertial pos="0 0 0" quat="0 0 0 1" mass="0.01" diaginertia="0.01 0.01 0.01" />
                    <geom size="0.009 0.0033 0.0175" pos="0.0 -0.0048 -0.015" rgba="0.5 1. 0.6 1" quat="0 0 0 1" type="box" solref="0.01 0.5" friction = "1 0 0" conaffinity="1" contype="1" name="finger1_tip_collision"/>

                </body>
            </body>


           
        </body>
    </worldbody>

    <sensor>
        <!-- <force name="force_ee" site="ft_frame"/> -->
        <!-- <torque name="torque_ee" site="ft_frame"/> -->

        <force name="touch_l1" site="touch_l5"></force>
        <force name="touch_l2" site="touch_l10"></force>
        <force name="touch_l3" site="touch_l15"></force>
        <force name="touch_l4" site="touch_l4"></force>
        <force name="touch_l5" site="touch_l9"></force>
        <force name="touch_l6" site="touch_l14"></force>
        <force name="touch_l7" site="touch_l3"></force>
        <force name="touch_l8" site="touch_l8"></force>
        <force name="touch_l9" site="touch_l13"></force>
        <force name="touch_l10" site="touch_l2"></force>
        <force name="touch_l11" site="touch_l7"></force>
        <force name="touch_l12" site="touch_l12"></force>
        <force name="touch_l13" site="touch_l1"></force>
        <force name="touch_l14" site="touch_l6"></force>
        <force name="touch_l15" site="touch_l11"></force>

        <!-- <touch name="touch_l1" site="touch_l1"></touch>
        <touch name="touch_l2" site="touch_l2"></touch>
        <touch name="touch_l3" site="touch_l3"></touch>
        <touch name="touch_l4" site="touch_l4"></touch>
        <touch name="touch_l5" site="touch_l5"></touch>
        <touch name="touch_l6" site="touch_l6"></touch>
        <touch name="touch_l7" site="touch_l7"></touch>
        <touch name="touch_l8" site="touch_l8"></touch>
        <touch name="touch_l9" site="touch_l9"></touch>
        <touch name="touch_l10" site="touch_l10"></touch>
        <touch name="touch_l11" site="touch_l11"></touch>
        <touch name="touch_l12" site="touch_l12"></touch>
        <touch name="touch_l13" site="touch_l13"></touch>
        <touch name="touch_l14" site="touch_l14"></touch>
        <touch name="touch_l15" site="touch_l15"></touch> -->


    </sensor>
</mujoco>
