<mujoco model="threejoint">

    <custom>
        <numeric name="START_ANGLES" data="0.0 0.0 0.0"/>
        <numeric name="N_JOINTS" data="3"/>
    </custom>

    <contact>
        <exclude body1="hand" body2="EE"/>
        <exclude body1="hand" body2="base_link"/>
        <exclude body1="hand" body2="link1"/>
        <exclude body1="hand" body2="link2"/>
        <exclude body1="hand" body2="link3"/>

        <exclude body1="target" body2="EE"/>
        <exclude body1="target" body2="base_link"/>
        <exclude body1="target" body2="link1"/>
        <exclude body1="target" body2="link2"/>
        <exclude body1="target" body2="link3"/>

        <exclude body1="path_planner" body2="EE"/>
        <exclude body1="path_planner" body2="base_link"/>
        <exclude body1="path_planner" body2="link1"/>
        <exclude body1="path_planner" body2="link2"/>
        <exclude body1="path_planner" body2="link3"/>
    </contact>

    <worldbody>
        <body name="hand" pos="0 0 0" mocap="true">
            <geom type="box" size=".02 .04 .06" rgba="0 .9 0 .5" contype="2"/>
        </body>
        <body name="target" pos="0 0 0" mocap="true">
            <geom type="sphere" size="0.05" rgba=".9 0 0 .5"/>
        </body>
        <body name="path_planner" pos="0 0 0" mocap="true">
            <geom type="sphere" size="0.05" rgba="0 0 1 0.5"/>
        </body>
        <body name="floor" pos="0 0 0" mocap="true">
            <geom type="box" size="1 1 0.001" rgba="0.99 0.99 0.99 1" contype="2"/>
        </body>

        <light pos="0 1 1" dir="0 -1 -1" diffuse="1 1 1"/>

        <body name="base_link" pos="0 0 0.05">
            <geom name="link0" type="cylinder" pos="0 0 0" size="0.025 0.05" rgba="0 0 1 0.9"/>
            <inertial pos="0 0 0" mass="4" diaginertia="0.1 0.1 0.1" />

            <body name="link1" pos="0 0 0.05">
                <joint name='joint0' pos="0 0 0" axis="0 0 1"/>
                <inertial pos="0 0 0.1" mass="2" diaginertia="0.226891 0.226891 0.0151074" />
                <geom name="link1" type="cylinder" pos="0 0 0.1" size="0.025 0.1" rgba="0 1 0 0.9"/>

                <body name="link2" pos="0 0 0.2">
                    <joint name='joint1' pos="0 0 0" axis="0 1 0"/>
                    <inertial pos="0 0 0.1" mass="2" diaginertia="0.226891 0.226891 0.0151074" />
                    <geom name="link2" type="cylinder" pos="0 0 0.1" size="0.025 0.1" rgba="1 1 0 0.9"/>

                    <body name="link3" pos="0 0 0.2">
                        <joint name='joint2' pos="0 0 0" axis="0 1 0"/>
                        <inertial pos="0 0 0.1" mass="2" diaginertia="0.226891 0.226891 0.0151074" />
                        <geom name="link3" type="cylinder" pos="0 0 0.1" size="0.025 0.1" rgba="1 0 1 0.9"/>

                        <body name="EE" pos="0 0 .2">
                            <inertial pos="0 0 0" mass="4" diaginertia="0.3 0.1 0.2" />
                        </body>
                    </body>
                </body>
            </body>
        </body>
    </worldbody>

    <actuator>
        <motor name="joint0_motor" joint="joint0"/>
        <motor name="joint1_motor" joint="joint1"/>
        <motor name="joint2_motor" joint="joint2"/>
    </actuator>

</mujoco>
