<mujoco model="iiwa7">
    <actuator>
        <!-- Physical limits of the actuator. -->
        <!-- Values taken from kuka_lbr_iiwa_brochure_en.pdf (see website) -->
        <motor ctrllimited="true" ctrlrange="-176.0 176.0" joint="joint_1" name="torq_j1"/>
        <motor ctrllimited="true" ctrlrange="-176.0 176.0" joint="joint_2" name="torq_j2"/>
        <motor ctrllimited="true" ctrlrange="-110.0 110.0" joint="joint_3" name="torq_j3"/>
        <motor ctrllimited="true" ctrlrange="-110.0 110.0" joint="joint_4" name="torq_j4"/>
        <motor ctrllimited="true" ctrlrange="-110.0 110.0" joint="joint_5" name="torq_j5"/>
        <motor ctrllimited="true" ctrlrange="-40.0 40.0" joint="joint_6" name="torq_j6"/>
        <motor ctrllimited="true" ctrlrange="-40.0 40.0" joint="joint_7" name="torq_j7"/>
    </actuator>
    <asset>
        <mesh name="link_0" file="meshes/link_0.stl" />
        <mesh name="link_1" file="meshes/link_1.stl" />
        <mesh name="link_2" file="meshes/link_2.stl" />
        <mesh name="link_3" file="meshes/link_3.stl" />
        <mesh name="link_4" file="meshes/link_4.stl" />
        <mesh name="link_5" file="meshes/link_5.stl" />
        <mesh name="link_6" file="meshes/link_6.stl" />
        <mesh name="link_7" file="meshes/link_7.stl" />
        <mesh name="link_0_vis" file="meshes/link_0_vis.stl" />
        <mesh name="link_1_vis" file="meshes/link_1_vis.stl" />
        <mesh name="link_2_vis" file="meshes/link_2_vis.stl" />
        <mesh name="link_3_vis" file="meshes/link_3_vis.stl" />
        <mesh name="link_4_vis" file="meshes/link_4_vis.stl" />
        <mesh name="link_5_vis" file="meshes/link_5_vis.stl" />
        <mesh name="link_6_vis" file="meshes/link_6_vis.stl" />
        <mesh name="link_7_vis" file="meshes/link_7_vis.stl" />
        <mesh file="../common_meshes/pedestal.stl" name="pedestal"/>

        <!-- Custom textures based on body names for domain randomization -->
        <texture type="cube" name="pedestal_tex" builtin="flat" width="100" height="100" rgb1="0.2 0.2 0.2" rgb2="0.2 0.2 0.2"/>

        <!-- Custom mats based on body names for domain randomization -->
        <material name="pedestal_mat" texture="pedestal_tex"/>
    </asset>
    <worldbody>
        <body name="base" pos="0 0 0">
            <!-- robot view -->
            <camera mode="fixed" name="robotview" pos="1.0 0 0.4" quat="0.653 0.271 0.271 0.653"/>
            <inertial diaginertia="0 0 0" mass="0" pos="0 0 0"/>
            <body name="controller_box" pos="0 0 0">
                <inertial diaginertia="1.71363 1.27988 0.809981" mass="46.64" pos="-0.325 0 -0.38"/>
                <geom pos="-0.325 0 -0.38" size="0.11 0.2 0.265" type="box" name="controller_box_col"/>
            </body>
            <body name="pedestal_feet" pos="0 0 0">
                <inertial diaginertia="8.16095 9.59375 15.0785" mass="167.09" pos="-0.1225 0 -0.758"/>
                <geom pos="-0.1225 0 -0.758" size="0.385 0.35 0.155" type="box" name="pedestal_feet_col"/>
            </body>
            <body name="torso" pos="0 0 0">
                <inertial diaginertia="1e-08 1e-08 1e-08" mass="0.0001" pos="0 0 0"/>
                <geom conaffinity="0" contype="0" group="1" rgba="0.2 0.2 0.2 1" size="0.05 0.05 0.05" type="box" name="torso_col"/>
            </body>
            <body name="pedestal" pos="0 0 0">
                <inertial diaginertia="6.0869 5.81635 4.20915" mass="60.864" pos="0 0 0" quat="0.659267 -0.259505 -0.260945 0.655692"/>
                <geom conaffinity="0" contype="0" group="1" mesh="pedestal" rgba="0.2 0.2 0.2 1" type="mesh" name="pedestal_col1" material="pedestal_mat" />
                <geom contype="0" pos="-0.02 0 -0.29" rgba="0.2 0.2 0.2 1" size="0.18 0.31" type="cylinder" name="pedestal_col2"/>
            </body>
            <geom type="mesh" pos="0 0 0" contype="0" conaffinity="0" group="1" rgba="0.4 0.4 0.4 1" mesh="link_0_vis" />
            <geom type="mesh" pos="0 0 0" rgba="0.4 0.4 0.4 1" contype="0" mesh="link_0" name="link_0_collision" />
            <body name="link_1" pos="0 0 0.15">
                <inertial pos="0 -0.03 0.12" quat="0.428904 0.562175 -0.562175 0.428904" mass="3.4525" diaginertia="0.0218946 0.02183 0.00663837" />
                <joint name="joint_1" pos="0 0 0" axis="0 0 1" limited="true" range="-2.96706 2.96706" damping="0.1" />
                <geom pos="0 0 0.0075" type="mesh" contype="0" conaffinity="0" group="1" rgba="0.4 0.4 0.4 1" mesh="link_1_vis" />
                <geom pos="0 0 0.0075" type="mesh" contype="0" rgba="0.4 0.4 0.4 1" mesh="link_1" name="link_1_collision" />
                <body name="link_2" pos="0 0 0.19" quat="0 0 0.707107 0.707107">
                    <inertial pos="0.0003 0.059 0.042" quat="0.701371 0.0898824 0.0898824 0.701371" mass="3.4821" diaginertia="0.02179 0.0217049 0.00684512" />
                    <joint name="joint_2" pos="0 0 0" axis="0 0 1" limited="true" range="-2.0944 2.0944" damping="0.1" />
                    <geom type="mesh" contype="0" conaffinity="0" group="1" rgba="1 0.423529 0.0392157 1" mesh="link_2_vis" />
                    <geom type="mesh" contype="0" rgba="1 0.423529 0.0392157 1" mesh="link_2" name="link_2_collision" />
                    <body name="link_3" pos="0 0.21 0" quat="0 0 0.707107 0.707107">
                        <inertial pos="0 0.03 0.13" quat="0.56292 0.427927 -0.427927 0.56292" mass="4.05623" diaginertia="0.0321488 0.03204 0.00799117" />
                        <joint name="joint_3" pos="0 0 0" axis="0 0 1" limited="true" range="-2.96706 2.96706" damping="0.1" />
                        <geom pos="0 0 -0.026" type="mesh" contype="0" conaffinity="0" group="1" rgba="0.4 0.4 0.4 1" mesh="link_3_vis" />
                        <geom pos="0 0 -0.026" type="mesh" contype="0" rgba="0.4 0.4 0.4 1" mesh="link_3" name="link_3_collision" />
                        <body name="link_4" pos="0 0 0.19" quat="0.707107 0.707107 0 0">
                            <inertial pos="0 0.067 0.034" quat="0.991887 -0.127124 0 0" mass="3.4822" diaginertia="0.02178 0.0216947 0.00684029" />
                            <joint name="joint_4" pos="0 0 0" axis="0 0 1" limited="true" range="-2.0944 2.0944" damping="0.1" />
                            <geom type="mesh" contype="0" conaffinity="0" group="1" rgba="1 0.423529 0.0392157 1" mesh="link_4_vis" />
                            <geom type="mesh" contype="0" rgba="1 0.423529 0.0392157 1" mesh="link_4" name="link_4_collision" />
                            <body name="link_5" pos="0 0.21 0" quat="0 0 0.707107 0.707107">
                                <inertial pos="0.0001 0.021 0.076" quat="0.365352 0.605407 -0.605407 0.365352" mass="2.1633" diaginertia="0.0131987 0.01287 0.0036293" />
                                <joint name="joint_5" pos="0 0 0" axis="0 0 1" limited="true" range="-2.96706 2.96706" damping="0.1" />
                                <geom pos="0 0 -0.026" type="mesh" contype="0" conaffinity="0" group="1" rgba="0.4 0.4 0.4 1" mesh="link_5_vis" />
                                <geom pos="0 0 -0.026" type="mesh" contype="0" rgba="0.4 0.4 0.4 1" mesh="link_5" name="link_5_collision" />
                                <body name="link_6" pos="0 0.0607 0.19" quat="0.707107 0.707107 0 0">
                                    <inertial pos="0 0.0006 0.0004" quat="0.996112 0.088097 0 0" mass="2.3466" diaginertia="0.006509 0.00631585 0.00447015" />
                                    <joint name="joint_6" pos="0 0 0" axis="0 0 1" limited="true" range="-2.0944 2.0944" damping="0.1" />
                                    <geom type="mesh" contype="0" conaffinity="0" group="1" rgba="1 0.423529 0.0392157 1" mesh="link_6_vis" />
                                    <geom type="mesh" contype="0" rgba="1 0.423529 0.0392157 1" mesh="link_6" name="link_6_collision" />
                                    <body name="link_7" pos="0 0.081 0.0607" quat="0 0 0.707107 0.707107">
                                        <inertial pos="0 0 0.02" quat="0.923068 0 0 0.384636" mass="3.129" diaginertia="0.0152362 0.0140538 0.002872" />
                                        <joint name="joint_7" pos="0 0 0" axis="0 0 1" limited="true" range="-3.05433 3.05433" damping="0.1" />
                                        <geom pos="0 0 -0.0005" type="mesh" contype="0" conaffinity="0" group="1" rgba="0.4 0.4 0.4 1" mesh="link_7_vis" />
                                        <geom pos="0 0 -0.0005" type="mesh" contype="0" rgba="0.4 0.4 0.4 1" mesh="link_7" name="link_7_collision" />
                                        <body name="right_hand" pos="0 0 0.044" >
                                            <!-- This sites were added for visualization. They are all standardized between models-->
                                            <!-- Position mimics the gripper attachment point (right_hand) -->
                                            <!--  Y-axis should be perpendicular to grasping motion, and Z-axis should point out of the robot eef -->
                                            <site name="ee" pos="0 0 0" size="0.01 0.01 0.01" rgba="0 0 1 1" type="sphere" group="1"/>
                                            <site name="ee_x" pos="0 0 0" size="0.005 .1"  quat="0.707105 0.707108 0 0 " rgba="1 0 0 0" type="cylinder" group="1"/>
                                            <site name="ee_z" pos="0 0 0" size="0.005 .1" quat="0.707105 0 0 0.707108" rgba="0 0 1 0" type="cylinder" group="1"/>
                                            <site name="ee_y" pos="0 0 0" size="0.005 .1" quat="0.707105 0 0.707108 0 " rgba="0 1 0 0" type="cylinder" group="1"/>
                                            <!-- This camera points out from the eef. -->
                                            <camera mode="fixed" name="eye_in_hand" pos="0.05 0 0" quat="0 0.707108 0.707108 0" fovy="75"/>
                                            <!-- To add gripper -->
                                        </body>
                                    </body>
                                </body>
                            </body>
                        </body>
                    </body>
                </body>
            </body>
        </body>
    </worldbody>
</mujoco>
