<?xml version="1.0"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com) 
     Commit Version: 1.6.0-4-g7f85cfe  Build Version: 1.6.7995.38578
     For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot name="sim" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="chassis">

    <!-- base link -->
    <link name="base_link">
        <inertial>
            <origin xyz="-3.9274E-14 -2.7443E-13 0.16087" rpy="0 0 0" />
            <mass value="0.31238" />
            <inertia ixx="0.0035443"  ixy="-3.9883E-18" ixz="-7.3407E-22"
                     iyy="1.5651E-05" iyz="2.4064E-18"  izz="0.0035443" />
        </inertial>
        <visual>
            <origin xyz="-0.005 0.0 0.15" rpy="0 0 0" />
            <geometry>
                <box size="0.59 0.617 0.20" />
            </geometry>
            <material name="">
                <color rgba="0.89804 0.91765 0.92941 1" />
            </material>
        </visual>
        <collision>
            <origin xyz="-0.005 0.0 0.15" rpy="0 0 0" />
            <geometry>
                <box size="0.59 0.617 0.20" />
            </geometry>
        </collision>
    </link>
    <gazebo reference="base_link">
        <material>Gazebo/White</material>
    </gazebo>

    <!-- left back wheel -->
    <link name="LeftBackWheel_Link">
    <inertial>
        <origin xyz="6.2681E-07 -0.0024922 4.309E-06" rpy="0 0 0" />
        <mass value="2.2978" />
        <inertia ixx="0.0056318" ixy="9.6362E-08" ixz="7.6946E-06"
                 iyy="0.0092712" iyz="2.4773E-07" izz="0.0056483" />
        </inertial>
        <visual>
            <origin xyz="0 0 0" rpy="1.57079637 0 0" />
            <geometry>
                <cylinder length="0.0001" radius="0.08285"/>
            </geometry>
            <material name="">
                <color rgba="0.5 0.5 0.5 1" />
            </material>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="1.57079637 0 0" />
            <geometry>
                <cylinder length="0.0001" radius="0.08285"/>
            </geometry>
        </collision>
    </link>
    <gazebo reference="LeftBackWheel_Link">
        <material>Gazebo/DarkGrey</material>
        <mu1>0.01</mu1>
        <mu2>0.01</mu2>
    </gazebo>
    <joint name="LeftBackWheel_joint" type="fixed">
        <origin xyz="-0.20636 0.2666 0.08285" rpy="0 0 0" />
        <parent link="base_link" />
        <child link="LeftBackWheel_Link" />
        <axis xyz="0 1 0" />
    </joint>

    <!-- left front wheel -->
    <link name="LeftFrontWheel_Link">
        <inertial>
            <origin xyz="6.2746E-07 -0.0024922 4.3083E-06" rpy="0 0 0" />
            <mass value="2.2978" />
            <inertia ixx="0.0056318" ixy="9.6416E-08" ixz="7.6946E-06"
                     iyy="0.0092712" iyz="2.4767E-07" izz="0.0056483" />
        </inertial>
        <visual>
            <origin xyz="0 0 0" rpy="1.57079637 0 0" />
            <geometry>
                <cylinder length="0.0001" radius="0.08285"/>
            </geometry>
            <material name="">
                <color rgba="0.5 0.5 0.5 1" />
            </material>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="1.57079637 0 0" />
            <geometry>
                <cylinder length="0.0001" radius="0.08285"/>
            </geometry>
        </collision>
    </link>
    <gazebo reference="LeftFrontWheel_Link">
        <material>Gazebo/DarkGrey</material>
        <mu1>0.01</mu1>
        <mu2>0.01</mu2>
    </gazebo>
    <joint name="LeftFrontWheel_joint" type="fixed">
        <origin xyz="0.20636 0.2666 0.08285" rpy="0 0 0" />
        <parent link="base_link" />
        <child link="LeftFrontWheel_Link" />
        <axis xyz="0 1 0" />
    </joint>
    
    <!-- right back wheel -->
    <link name="RightBackWheel_Link">
        <inertial>
            <origin xyz="9.9705E-07 0.0024922 4.1668E-06" rpy="0 0 0" />
            <mass value="2.2978" />
            <inertia ixx="0.0056315" ixy="-9.4155E-08" ixz="7.3776E-06"
                     iyy="0.0092712" iyz="-2.4857E-07" izz="0.0056485" />
        </inertial>
        <visual>
            <origin xyz="0 0 0" rpy="1.57079637 0 0" />
            <geometry>
                <cylinder length="0.0001" radius="0.08285"/>
            </geometry>
            <material name="">
                <color rgba="0.5 0.5 0.5 1" />
            </material>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="1.57079637 0 0" />
            <geometry>
                <cylinder length="0.0001" radius="0.08285"/>
            </geometry>
        </collision>
    </link>
    <gazebo reference="RightBackWheel_Link">
        <material>Gazebo/DarkGrey</material>
        <mu1>0.01</mu1>
        <mu2>0.01</mu2>
    </gazebo>
    <joint name="RightBackWheel_joint" type="fixed">
        <origin xyz="-0.20636 -0.2666 0.08285" rpy="0 0 0" />
        <parent link="base_link" />
        <child link="RightBackWheel_Link" />
        <axis xyz="0 1 0" />
    </joint>
  
    <!-- right front wheel -->
    <link name="RightFrontWheel_Link">
        <inertial>
            <origin xyz="0 0 0" rpy="0 0 0" />
            <mass value="2.2978" />
            <inertia ixx="0.0056318" ixy="9.6416E-08" ixz="7.6946E-06"
                     iyy="0.0092712" iyz="2.4767E-07" izz="0.0056483" />
        </inertial>
        <visual>
            <origin xyz="0 0 0" rpy="1.57079637 0 0" />
            <geometry>
                <cylinder length="0.0001" radius="0.08285"/>
            </geometry>
            <material name="">
                <color rgba="0.5 0.5 0.5 1" />
            </material>
        </visual>
        <collision>
            <origin xyz="0 0 0" rpy="1.57079637 0 0" />
            <geometry>
                <cylinder length="0.0001" radius="0.08285"/>
            </geometry>
        </collision>
    </link>
    <gazebo reference="RightFrontWheel_Link">
        <material>Gazebo/DarkGrey</material>
        <mu1>0.01</mu1>
        <mu2>0.01</mu2>
    </gazebo>
    <joint name="RightFrontWheel_joint" type="fixed">
        <origin xyz="0.20636 -0.2666 0.08285" rpy="0 0 0" />
        <parent link="base_link" />
        <child link="RightFrontWheel_Link" />
        <axis xyz="0 1 0" />
    </joint>

    <!-- controller -->
    <gazebo>
        <plugin name="mecanum_controller" filename="libgazebo_ros_planar_move.so">
            <commandTopic>cmd_vel</commandTopic>
            <odometryTopic>odom</odometryTopic>
            <odometryFrame>odom</odometryFrame>
            <rightFrontJoint>RightFrontWheel_joint</rightFrontJoint>
            <rightRearJoint>RightBackWheel_joint</rightRearJoint>
            <leftFrontJoint>LeftFrontWheel_joint</leftFrontJoint>
            <leftRearJoint>LeftBackWheel_joint</leftRearJoint>
            <odometryRate>100</odometryRate>
            <robotBaseFrame>base_link</robotBaseFrame>
            <broadcastTF>1</broadcastTF>
        </plugin>
    </gazebo>

</xacro:macro>
</robot>
