<mujoco model="arm3d">
  <compiler inertiafromgeom="true" angle="radian" coordinate="local"/>
  <option timestep="0.01" gravity="0 0 0" iterations="20" integrator="Euler" />

  <default>
    <joint armature='0.04' damping="1" limited="true"/>
    <geom friction=".8 .1 .1" density="300" margin="0.002" condim="1" contype="0" conaffinity="0"/>
  </default>

   <size nstack="1000000"/>

   <asset>
      <texture type="skybox" builtin="gradient" width="128" height="128" rgb1=".4 .6 .8"
         rgb2="0 0 0"/>
      <texture name="texgeom" type="cube" builtin="flat" mark="cross" width="127" height="1278"
         rgb1="0.8 0.6 0.4" rgb2="0.8 0.6 0.4" markrgb="1 1 1" random="0.01"/>
      <texture name="texplane" type="2d" builtin="checker" rgb1=".2 .3 .4" rgb2=".1 0.15 0.2"
         width="512" height="512"/>

      <material name='MatPlane' reflectance='0.3' texture="texplane" texrepeat="1 1" texuniform="true"/>
      <material name='geom' texture="texgeom" texuniform="true"/>
   </asset>

  <worldbody>
    <!-- <light diffuse="1 1 1" pos="0 -2 0.5" dir="0 1 -0.1" directional="true"/> -->
    <geom name="table" rgba="1 1 1 1" type="plane" pos="0 0.5 -0.325" size="1 1 0.1" contype="1" conaffinity="1"/>

    <body name="pusher" pos="-0.08 0.0 -0.305">
      <body name="r_wrist_flex_link" pos="0 0 0">
        <geom name="wf" rgba="0 1 0 1" type="capsule" fromto="0 -0.02 0 0 0.02 0" size="0.01" />
        <joint name="push_slidex" type="slide" pos="0 0 0" axis="1 0 0" range="-10.3213 10.3" damping="0.1"/>
        <joint name="push_slidey" type="slide" pos="0 0 0" axis="0 1 0" range="-10.3213 10.3" damping="0.1"/>
        <joint name="push_hinge"  type="hinge" pos="0 0 0" axis="0 0 1" range="-1000. 1000.0" damping="0.1"/>
        <body name="r_wrist_roll_link" pos="0 0 0">
          <body name="tips_arm" pos="0 0 0">
            <geom name="tip_arml" type="sphere" pos="0.1 -0.1 0." size="0.01" />
            <geom name="tip_armr" type="sphere" pos="0.1 0.1 0." size="0.01" />
          </body>
          <geom type="capsule" rgba="0 1 0 1"  fromto="0 -0.1 0. 0.0 +0.1 0" size="0.02" contype="1" conaffinity="1" />
          <geom type="capsule" rgba="0 1 0 1"  fromto="0 -0.1 0. 0.1 -0.1 0" size="0.02" contype="1" conaffinity="1" />
          <geom type="capsule" rgba="0 1 0 1"  fromto="0 +0.1 0. 0.1 +0.1 0." size="0.02" contype="1" conaffinity="1" />
        </body>
      </body>
    </body>

    <body name="object" pos="0.0 0.0 -0.275" >
      <geom rgba="0 0 1 0" type="sphere" size="0.05 0.05 0.05" density="0.00001" conaffinity="0"/>
      <geom rgba="0 0 1 1" type="cylinder" size="0.05 0.05 0.05" density="0.00001" contype="1" conaffinity="0"/>
      <joint name="obj_slidex" type="slide" pos="0 0 0" axis="1 0 0" range="-10.3213 10.3" damping="0.5"/>
      <joint name="obj_slidey" type="slide" pos="0 0 0" axis="0 1 0" range="-10.3213 10.3" damping="0.5"/>
    </body>

    <geom name='target' rgba="1 0 0 1"  type='capsule' fromto='0.2 -0.2 -0.275 0.2 -0.2 0.05'  size='0.03' contype='0' conaffinity='0'/>

  </worldbody>

  <actuator>
    <motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="0.05" joint="push_slidex"/>
    <motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="0.08" joint="push_slidey"/>
    <motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="0.01" joint="push_hinge"/>
  </actuator>
</mujoco>
