<mujoco model="arm3d">
    <compiler inertiafromgeom="true" angle="radian" coordinate="local"/>
    <custom>
        <numeric name="frame_skip" data="5"/>
    </custom>
    <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="1" conaffinity="1"/>
    </default>

    <worldbody>
        <light diffuse=".5 .5 .5" pos="0 0 3" dir="0 0 -1"/>
        <geom type="plane" pos="0 0.5 -0.15" size="4 4 0.1" contype="1" conaffinity="1"/>

        <body name="palm" pos="0 0 0">
            <geom rgba="0. 1. 0. 1" type="capsule" fromto="0 0 -0.1 0 0 0.1" size="0.12"/>
            <body name="proximal_1" pos="0 0 -0.075" axisangle="0 0 1 0.785">
                <joint name="proximal_j_1" type="hinge" pos="0 0 0" axis="0 0 1" range="-2.5 2.5" damping="1.0"/>
                <geom rgba="0. 1. 0. 1" type="capsule" fromto="0 0 0 0.4 0 0" size="0.06" contype="1" conaffinity="1"/>
                <body name="distal_1" pos="0.4 0 0" axisangle="0 0 1 -0.785">
                    <joint name="distal_j_1" type="hinge" pos="0 0 0" axis="0 0 1" range="-2.3213 2.3" damping="1.0"/>
                    <geom rgba="0. 1. 0. 1" type="capsule" fromto="0 0 0 0.4 0 0" size="0.06" contype="1"
                          conaffinity="1"/>
                    <body name="distal_2" pos="0.4 0 0" axisangle="0 0 1 +0.57">
                        <joint name="distal_j_2" type="hinge" pos="0 0 0" axis="0 0 1" range="-2.3213 2.3"
                               damping="1.0"/>
                        <geom rgba="0. 1. 0. 1" type="capsule" fromto="0 0 0 0.4 0 0" size="0.06" contype="1"
                              conaffinity="1"/>
                        <body name="distal_3" pos="0.4 0 0" axisangle="0 0 1 -1.57">
                            <joint name="distal_j_3" type="hinge" pos="0 0 0" axis="0 0 1" range="-2.3213 2.3"
                                   damping="1.0"/>
                            <geom rgba="0. 1. 0. 1" type="capsule" fromto="0 0 0 0.4 0 0" size="0.06" contype="1"
                              conaffinity="1"/>
                            <body name="distal_4" pos="0.4 0 0">
                                <body name="tips_arm" pos="0 0 0">
                                    <geom name="tip_arml" type="sphere" pos="0.1 -0.2 0" size="0.01"/>
                                    <geom name="tip_armr" type="sphere" pos="0.1 0.2 0" size="0.01"/>
                                </body>
                                <geom rgba="0. 1. 0. 1" type="capsule" fromto="0 -0.2 0 0 0.2 0" size="0.04" contype="1"
                                      conaffinity="1"/>
                                <geom rgba="0. 1. 0. 1" type="capsule" fromto="0 -0.2 0 0.2 -0.2 0" size="0.04" contype="1"
                                      conaffinity="1"/>
                                <geom rgba="0. 1. 0. 1" type="capsule" fromto="0 0.2 0 0.2 0.2 0" size="0.04" contype="1"
                                      conaffinity="1"/>
                            </body>
                        </body>    
                    </body>
                </body>
            </body>
        </body>

        <body name="object" pos="-0.25 0.15 -0.1">
            <!--<geom rgba="1. 1. 1. 1" type="box" size="0.05 0.05 0.05" density='0.00001' contype="1" conaffinity="1"/>-->
            <geom rgba="0 0 1 1" type="cylinder" size=".1 0.1 0.1" density='0.5' contype="1" conaffinity="1"/>
            <joint name="obj_slidex" type="slide" pos="0.0025 0.0025 0.0025" axis="1 0 0" range="-10.3213 10.3"
                   damping="0.01" frictionloss="0.01"/>
            <joint name="obj_slidey" type="slide" pos="0.0025 0.0025 0.0025" axis="0 1 0" range="-10.3213 10.3"
                   damping="0.01" frictionloss="0.01"/>
        </body>
        <body name="object_box_1" pos="-0.8 -0.0 -0.1">
            <inertial pos="0 0 0" mass="1000000" diaginertia="1666.667 1666.667 1666.667"/>
            <geom rgba="1. 1. 1. 1" type="box" size="0.1 0.1 0.15" density='1000' contype="1" conaffinity="1"/>
        </body>

        <body name="object_box_2" pos="+0.75 +0.0 -0.1">
            <inertial pos="0 0 0" mass="1000000" diaginertia="1666.667 1666.667 1666.667"/>
            <geom rgba="1. 1. 1. 1" type="box" size="0.1 0.065 0.1" density='1000' contype="1" conaffinity="1"/>
        </body>        
        <body name="object_box_3" pos="0 0.85 -0.1">
            <inertial pos="0 0 0" mass="1000000" diaginertia="1666.667 1666.667 1666.667"/>
            <geom rgba="1. 1. 1. 1" type="box" size="0.1 0.15 0.15" density='1000' contype="1" conaffinity="1"/>
        </body>

        <body name="object_box_4" pos="+0.0 -0.9 -0.1">
            <inertial pos="0 0 0" mass="1000000" diaginertia="1666.667 1666.667 1666.667"/>
            <geom rgba="1. 1. 1. 1" type="box" size="0.15 0.15 0.2" density='1000' contype="1" conaffinity="1"/>
        </body>        

        <body name="object_box_5" pos="+0.5 +0.8 -0.1">
            <inertial pos="0 0 0" mass="1000000" diaginertia="1666.667 1666.667 1666.667"/>
            <geom rgba="1. 1. 1. 1" type="box" size="0.1 0.13 0.13" density='1000' contype="1" conaffinity="1"/>
        </body>

        <body name="object_box_6" pos="-0.6 -0.6  -0.1">
            <inertial pos="0 0 0" mass="1000000" diaginertia="1666.667 1666.667 1666.667"/>
            <geom rgba="1. 1. 1. 1" type="box" size="0.15 0.12 0.12" density='1000' contype="1" conaffinity="1"/>
        </body>        

        <body name="object_box_7" pos="+0.8 -0.6  -0.1">
            <inertial pos="0 0 0" mass="1000000" diaginertia="1666.667 1666.667 1666.667"/>
            <geom rgba="1. 1. 1. 1" type="box" size="0.14 0.06 0.2" density='1000' contype="1" conaffinity="1"/>
        </body>

        <body name="object_box_8" pos="-0.8 +0.6  -0.1">
            <inertial pos="0 0 0" mass="1000000" diaginertia="1666.667 1666.667 1666.667"/>
            <geom rgba="1. 1. 1. 1" type="box" size="0.05 0.15 0.15" density='1000' contype="1" conaffinity="1"/>
        </body>


        <body name="goal" pos="-0.2 -.1 -0.145">
            <geom rgba="1. 0. 0. 1" type="cylinder" size="0.17 0.005 0.2" density='0.00001' contype="0"
                  conaffinity="0"/>
            <joint name="goal_slidex" type="slide" pos="0 0 0" axis="1 0 0" range="-10.3213 10.3" damping="0.5"/>
            <joint name="goal_slidey" type="slide" pos="0 0 0" axis="0 1 0" range="-10.3213 10.3" damping="0.5"/>
        </body>

    </worldbody>

    <actuator>
        <motor joint="proximal_j_1" ctrlrange="-3 3" ctrllimited="true"/>
        <motor joint="distal_j_1" ctrlrange="-3 3" ctrllimited="true"/>
        <motor joint="distal_j_2" ctrlrange="-3 3" ctrllimited="true"/>
        <motor joint="distal_j_3" ctrlrange="-3 3" ctrllimited="true"/>
    </actuator>
</mujoco>