<mujoco model="pushing2d">

    <compiler inertiafromgeom="auto" angle="radian" coordinate="local" eulerseq="XYZ"/>
    <option timestep="0.005" gravity="0 0 -9.81" iterations="50" integrator="Euler" />
    <default>
        <joint limited="false" damping="1" />
        <geom contype="1" conaffinity="1" condim="3" friction=".5 .1 .1" density="1000" margin="0.002" />
    </default>

    <worldbody>
        <camera name="maincam" mode= "fixed" fovy="32" euler="0.7 0 0" pos="0 -1.1 1.3"/>
        <camera name="leftcam" mode= "fixed" fovy="32" euler="0.7 0 -1.57" pos="-1.1 0 1.3"/>
        <!-- <camera name="leftcam" mode= "fixed" fovy="32" euler="0.7 0 -1.57" pos="-0.5 -1 1.3"/> -->
        <body name="gripper" pos="0 0 0.25">
            <inertial pos="0 0 0" mass="1" diaginertia="16.667 16.667 16.667"/>
            <geom type="box" size=".1 .03 .03" rgba="0.1 0.0 0.9 1" contype="0" conaffinity="0"/>
            <geom type="box" size=".07 .035 1" rgba="0.9 0.9 0.9 1" pos="0 0 1" contype="0" conaffinity="0"/>

            <joint name="slide_x" type="slide" pos="0 0 0" axis="1 0 0" limited="true" range="-0.5 0.5" armature="0" damping="30" stiffness="0"/>
            <joint name="slide_y" type="slide" pos="0 0 0" axis="0 1 0" limited="true" range="-0.5 0.5" armature="0" damping="30" stiffness="0"/>
            <joint name="slide_z" type="slide" pos="0 0 0" axis="0 0 1"  limited="true" range="-0.08 0.15"/>

            <joint name="hinge_z" type="hinge" pos="0 0 0" axis="0 0 1" limited="true" range="-6.28 6.28" damping="30"/>


            <body name="fingers" pos="'0 0 0">


                <body name="finger1" pos="-0.08 0 -0.1">
                    <joint name="j_finger1" type="slide" pos="0 0 0" axis="1 0 0"  limited="true" range="0.0 0.0615" />
                    <!--<geom contype="1" conaffinity="1" type="box" size=".01 .02 .1" rgba="0.3 0.3 0.3 1"  mass="0.08"/>-->
                    <geom condim="6" contype="2" conaffinity="2" type="box" size=".01 .02 .1" rgba="0.3 0.3 0.3 1"  mass="0.08"/> <!-- solimp="0.99 0.99 0.01" solref="0.01 1" /> -->
                    <site name="finger1_surf" pos="0.01 0 0" size=".0025 .0190 .095" type="box" rgba="0.0 1.0 0.0 0"/>

                </body>

                <body name="finger2" pos="0.08 0 -0.1">
                    <joint name="j_finger2" type="slide" pos="0 0 0" axis="1 0 0" />
                    <!--<geom contype="1" conaffinity="1"  type="box" size=".01 .02 .1" rgba="0.3 0.3 0.3 1" mass="0.08"/>-->
                    <geom condim="6" contype="4" conaffinity="4"  type="box" size=".01 .02 .1" rgba="0.3 0.3 0.3 1" mass="0.08" /> <!-- solimp="0.99 0.99 0.01" solref="0.01 1" />-->
                    <site name="finger2_surf" pos="-0.01 0 0" size=".0025 .0190 .095" type="box" rgba="1.0 0.0 0.0 0"/>
                </body>
            </body>


        </body>


        <body name="container" pos="0  0  -0.05">

            <body name="border_front" pos="0 -.5  0">
                 <geom type="box" size=".5 .01 .1" rgba="0 .1 .9 .3" />
            </body>

            <body name="border_rear" pos="0 .5  0">
                 <geom type="box" size=".5 .01 .1" rgba="0 .1 .9 .3" />
            </body>

            <body name="border_right" pos=".5 0  0">
                 <geom type="box" size=".01  .5 .1" rgba="0 .1 .9 .3" />
            </body>

            <body name="border_left" pos="-.5 0  0">
                 <geom type="box" size=".01  .5 .1" rgba="0 .1 .9 .3" />
            </body>

            <body name="table" pos="0 0 -.01">
                 <geom type="box" size=".5  .5 .01" rgba="0 .9 0 1" contype="7" conaffinity="7"/>
            </body>

            <!--<body name="invisible_border_front" pos="0 -.5  0">-->
                 <!--<geom type="box" size=".5 .01 0.5" rgba="0 .1 .9 0."/>-->
            <!--</body>-->

            <!--<body name="invisible_border_rear" pos="0 .5  0">-->
                 <!--<geom type="box" size=".5 .01 0.5" rgba="0 .1 .9 0."/>-->
            <!--</body>-->

            <!--<body name="invisible_border_right" pos=".5 0  0">-->
                 <!--<geom type="box" size=".01 .5 0.5" rgba="0 .1 .9 0."/>-->
            <!--</body>-->

            <!--<body name="invisible_border_left" pos="-.5 0  0">-->
                 <!--<geom type="box" size=".01 .5 0.5" rgba="0 .1 .9 0."/>-->
            <!--</body>-->
        </body>

        <body name="light_body0" pos="0 0  1">
             <light name="light0" mode="fixed" directional="false" active="true" castshadow="true"/>
        </body>
    </worldbody>

    <!--begin_auto_replace -->
        <include file="objects.xml"/>
    <!--end_auto_replace -->

    <actuator>
        <position joint="slide_x" ctrllimited="false" kp="200"/>
        <position joint="slide_y" ctrllimited="false" kp="200"/>
        <!--<position joint="slide_x" ctrllimited="false" kp="0.8"/>-->
        <!--<position joint="slide_y" ctrllimited="false" kp="0.8"/>-->

        <!--<general joint="slide_z" gaintype="fixed" dyntype="none" dynprm="1 0 0" gainprm ="30 0 0" biastype="affine" biasprm="295.869 0 -50"/>-->
        <general joint="slide_z" gaintype="fixed" dyntype="none" dynprm="1 0 0" gainprm ="100 0 0" biastype="affine" biasprm="10 -100 -4"/>

        <position joint="hinge_z" ctrllimited="false" kp="300"/>

        <position joint="j_finger1" ctrllimited="true" ctrlrange = "0 0.1" kp="300"/>
    </actuator>


    <equality>
        <joint joint1="j_finger1" joint2="j_finger2" polycoef="0 -1 0 0 0" />
    </equality>

</mujoco>
