<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from src/bot_model/urdf/bcr_bot.xacro | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="bcr_bot">
  <!--................................ XACRO CONSTANTS .............................. -->
  <!-- ............................... LOAD MACROS ................................. -->
  <material name="black">
    <color rgba="0.0 0.0 0.0 1.0"/>
  </material>
  <material name="blue">
    <color rgba="0.0 0.0 0.8 1.0"/>
  </material>
  <material name="green">
    <color rgba="0.0 0.8 0.0 1.0"/>
  </material>
  <material name="yellow">
    <color rgba="1.0 1.0 0.0 1.0"/>
  </material>
  <material name="dark_grey">
    <color rgba="0.2 0.2 0.2 1.0"/>
  </material>
  <material name="orange">
    <color rgba="1.0 0.4235294117647059 0.0392156862745098 1.0"/>
  </material>
  <material name="brown">
    <color rgba="0.5450980392156862 0.27058823529411763 0.07450980392156863 1.0"/>
  </material>
  <material name="red">
    <color rgba="0.8 0.0 0.0 1.0"/>
  </material>
  <material name="turquoise">
    <color rgba="0.25098039215686274 0.8784313725490196 0.8156862745098039 1.0"/>
  </material>
  <material name="purple">
    <color rgba="0.5019607843137255 0.0 0.5019607843137255 1.0"/>
  </material>
  <material name="white">
    <color rgba="1.0 1.0 1.0 1.0"/>
  </material>
  <material name="aluminium">
    <color rgba="0.5 0.5 0.5 1"/>
  </material>
  <material name="plastic">
    <color rgba="0.1 0.1 0.1 1"/>
  </material>
  <!--................................ INERTIA MATRICES .............................. -->
  <!-- ............................... TROLLEY WHEEL DEFINITION .............................. -->
  <!-- ........................... SENSOR PLUGIN ................................... -->
  <gazebo>
    <plugin filename="gz-sim-sensors-system" name="gz::sim::systems::Sensors">
      <render_engine>ogre2</render_engine>
    </plugin>
    <plugin filename="gz-sim-imu-system" name="gz::sim::systems::Imu">
        </plugin>
    <plugin filename="gz-sim-joint-state-publisher-system" name="gz::sim::systems::JointStatePublisher">
        </plugin>
    <!-- ........................... DIFFERENTIAL DRIVE PLUGIN ................................... -->
    <plugin filename="gz-sim-diff-drive-system" name="gz::sim::systems::DiffDrive">
      <left_joint>middle_left_wheel_joint</left_joint>
      <right_joint>middle_right_wheel_joint</right_joint>
      <wheel_separation>0.64</wheel_separation>
      <wheel_radius>0.11</wheel_radius>
      <odom_publish_frequency>30</odom_publish_frequency>
      <topic>/cmd_vel</topic>
      <frame_id>odom</frame_id>
      <child_frame_id>base_footprint</child_frame_id>
    </plugin>
  </gazebo>
  <!-- ............................. ground truth .................................... -->
  <gazebo>
    <plugin filename="libgz-sim-odometry-publisher-system" name="gz::sim::systems::OdometryPublisher">
      <odom_frame>odom</odom_frame>
      <robot_base_frame>base_footprint</robot_base_frame>
      <odom_topic>odom</odom_topic>
      <tf_topic>/tf</tf_topic>
      <dimensions>2</dimensions>
      <odom_publish_frequency>10</odom_publish_frequency>
    </plugin>
  </gazebo>
  <!-- ........................... 2D LIDAR config ................................... -->
  <gazebo reference="two_d_lidar">
    <sensor name="gpu_lidar" type="gpu_lidar">
      <topic>scan</topic>
      <update_rate>30</update_rate>
      <gz_frame_id>two_d_lidar</gz_frame_id>
      <lidar>
        <scan>
          <horizontal>
            <samples>361</samples>
            <resolution>1</resolution>
            <min_angle>0.0</min_angle>
            <max_angle>6.283185307179586</max_angle>
          </horizontal>
        </scan>
        <range>
          <min>0.55</min>
          <max>16</max>
          <resolution>0.01</resolution>
        </range>
        <noise>
          <type>gaussian</type>
          <mean>0.0</mean>
          <stddev>0.001</stddev>
        </noise>
      </lidar>
      <always_on>1</always_on>
      <visualize>true</visualize>
    </sensor>
  </gazebo>
  <!-- ........................... CAMERA config ................................... -->
  <gazebo reference="kinect_camera">
    <sensor name="kinect_camera" type="depth_camera">
      <update_rate>10.0</update_rate>
      <topic>kinect_camera</topic>
      <gz_frame_id>kinect_camera</gz_frame_id>
      <camera>
        <camera_info_topic>kinect_camera/camera_info</camera_info_topic>
        <horizontal_fov>1.0471975511965976</horizontal_fov>
        <image>
          <width>640</width>
          <height>480</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.05</near>
          <far>8.0</far>
        </clip>
      </camera>
    </sensor>
  </gazebo>
  <!-- ........................... IMU config ................................... -->
  <gazebo reference="imu_frame">
    <sensor name="imu_sensor" type="imu">
      <always_on>1</always_on>
      <update_rate>1</update_rate>
      <gz_frame_id>imu_frame</gz_frame_id>
      <visualize>true</visualize>
      <topic>imu</topic>
    </sensor>
  </gazebo>
  <gazebo reference="stereo_camera">
    <sensor name="right" type="camera">
      <update_rate>10.0</update_rate>
      <always_on>true</always_on>
      <gz_frame_id>stereo_camera_optical</gz_frame_id>
      <pose>0 -0.12 0 0 0 0</pose>
      <topic>stereo_camera/right/image_raw</topic>
      <camera_info_topic>stereo_camera/right/camera_info</camera_info_topic>
      <horizontal_fov>1.3962634</horizontal_fov>
      <image>
        <width>1024</width>
        <height>1024</height>
        <format>R8G8B8</format>
      </image>
      <clip>
        <near>0.3</near>
        <far>20</far>
      </clip>
    </sensor>
    <sensor name="left" type="camera">
      <topic>stereo_camera/left/image_raw</topic>
      <update_rate>10.0</update_rate>
      <always_on>true</always_on>
      <gz_frame_id>stereo_camera_optical</gz_frame_id>
      <camera_info_topic>stereo_camera/left/camera_info</camera_info_topic>
      <pose>0 0 0 0 0 0</pose>
      <horizontal_fov>1.3962634</horizontal_fov>
      <image>
        <width>1024</width>
        <height>1024</height>
        <format>R8G8B8</format>
      </image>
      <clip>
        <near>0.3</near>
        <far>20</far>
      </clip>
    </sensor>
  </gazebo>
  <!-- ................................ BASE LINK .................................. -->
  <link name="base_footprint"/>
  <link name="base_link"/>
  <joint name="base_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link"/>
    <origin rpy="0 0 0.0" xyz="0.0 0 0.195"/>
  </joint>
  <link name="chassis_link">
    <collision>
      <origin rpy="0 0 0" xyz="0 0 -0.05"/>
      <geometry>
        <box size="0.9 0.64 0.19"/>
      </geometry>
    </collision>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 -0.205"/>
      <geometry>
        <mesh filename="meshes/bcr_bot_mesh.dae" scale="1 1 1"/>
      </geometry>
    </visual>
    <inertial>
      <mass value="70"/>
      <inertia ixx="2.5999166666666667" ixy="0" ixz="0" iyy="4.935583333333334" iyz="0" izz="7.114333333333334"/>
    </inertial>
  </link>
  <joint name="chassis_joint" type="fixed">
    <parent link="base_link"/>
    <child link="chassis_link"/>
    <origin rpy="0 0 0.0" xyz="0.0 0 0"/>
  </joint>
  <!-- ................................ WHEELS ..................................... -->
  <link name="front_left_wheel">
    <collision>
      <origin rpy="0 1.5707963267948966 1.5707963267948966" xyz="0 0 0"/>
      <geometry>
        <sphere radius="0.06"/>
      </geometry>
    </collision>
    <inertial>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <mass value="0.1"/>
      <inertia ixx="0.00014399999999999998" ixy="0" ixz="0" iyy="0.00014399999999999998" iyz="0" izz="0.00014399999999999998"/>
    </inertial>
    <mu>0.0</mu>
  </link>
  <joint name="front_left_wheel_joint" type="fixed">
    <parent link="base_link"/>
    <child link="front_left_wheel"/>
    <origin rpy="0 0 0" xyz="0.45 0.27 -0.155"/>
    <axis rpy="0 0 0" xyz="0 1 0"/>
  </joint>
  <gazebo reference="front_left_wheel">
    <material>Gazebo/Black</material>
  </gazebo>
  <link name="front_right_wheel">
    <collision>
      <origin rpy="0 1.5707963267948966 1.5707963267948966" xyz="0 0 0"/>
      <geometry>
        <sphere radius="0.06"/>
      </geometry>
    </collision>
    <inertial>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <mass value="0.1"/>
      <inertia ixx="0.00014399999999999998" ixy="0" ixz="0" iyy="0.00014399999999999998" iyz="0" izz="0.00014399999999999998"/>
    </inertial>
    <mu>0.0</mu>
  </link>
  <joint name="front_right_wheel_joint" type="fixed">
    <parent link="base_link"/>
    <child link="front_right_wheel"/>
    <origin rpy="0 0 0" xyz="0.45 -0.27 -0.155"/>
    <axis rpy="0 0 0" xyz="0 1 0"/>
  </joint>
  <gazebo reference="front_right_wheel">
    <material>Gazebo/Black</material>
  </gazebo>
  <link name="back_left_wheel">
    <collision>
      <origin rpy="0 1.5707963267948966 1.5707963267948966" xyz="0 0 0"/>
      <geometry>
        <sphere radius="0.06"/>
      </geometry>
    </collision>
    <inertial>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <mass value="0.1"/>
      <inertia ixx="0.00014399999999999998" ixy="0" ixz="0" iyy="0.00014399999999999998" iyz="0" izz="0.00014399999999999998"/>
    </inertial>
    <mu>0.0</mu>
  </link>
  <joint name="back_left_wheel_joint" type="fixed">
    <parent link="base_link"/>
    <child link="back_left_wheel"/>
    <origin rpy="0 0 0" xyz="-0.45 0.27 -0.155"/>
    <axis rpy="0 0 0" xyz="0 1 0"/>
  </joint>
  <gazebo reference="back_left_wheel">
    <material>Gazebo/Black</material>
  </gazebo>
  <link name="back_right_wheel">
    <collision>
      <origin rpy="0 1.5707963267948966 1.5707963267948966" xyz="0 0 0"/>
      <geometry>
        <sphere radius="0.06"/>
      </geometry>
    </collision>
    <inertial>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <mass value="0.1"/>
      <inertia ixx="0.00014399999999999998" ixy="0" ixz="0" iyy="0.00014399999999999998" iyz="0" izz="0.00014399999999999998"/>
    </inertial>
    <mu>0.0</mu>
  </link>
  <joint name="back_right_wheel_joint" type="fixed">
    <parent link="base_link"/>
    <child link="back_right_wheel"/>
    <origin rpy="0 0 0" xyz="-0.45 -0.27 -0.155"/>
    <axis rpy="0 0 0" xyz="0 1 0"/>
  </joint>
  <gazebo reference="back_right_wheel">
    <material>Gazebo/Black</material>
  </gazebo>
  <link name="middle_left_wheel">
    <collision>
      <origin rpy="0 1.5707963267948966 1.5707963267948966" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.05" radius="0.1"/>
      </geometry>
      <self_collide>false</self_collide>
    </collision>
    <inertial>
      <origin rpy="0 1.5707963267948966 1.5707963267948966" xyz="0 0 0"/>
      <mass value="1"/>
      <inertia ixx="0.002708333333333334" ixy="0" ixz="0" iyy="0.002708333333333334" iyz="0" izz="0.005000000000000001"/>
    </inertial>
    <mu>5.0</mu>
  </link>
  <joint name="middle_left_wheel_joint" type="continuous">
    <parent link="base_link"/>
    <child link="middle_left_wheel"/>
    <origin rpy="0 0 0" xyz="0 0.3 -0.11699999999999999"/>
    <axis rpy="0 0 0" xyz="0 1 0"/>
  </joint>
  <gazebo reference="middle_left_wheel">
    <material>Gazebo/Black</material>
  </gazebo>
  <link name="middle_right_wheel">
    <collision>
      <origin rpy="0 1.5707963267948966 1.5707963267948966" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.05" radius="0.1"/>
      </geometry>
      <self_collide>false</self_collide>
    </collision>
    <inertial>
      <origin rpy="0 1.5707963267948966 1.5707963267948966" xyz="0 0 0"/>
      <mass value="1"/>
      <inertia ixx="0.002708333333333334" ixy="0" ixz="0" iyy="0.002708333333333334" iyz="0" izz="0.005000000000000001"/>
    </inertial>
    <mu>5.0</mu>
  </link>
  <joint name="middle_right_wheel_joint" type="continuous">
    <parent link="base_link"/>
    <child link="middle_right_wheel"/>
    <origin rpy="0 0 0" xyz="0 -0.3 -0.11699999999999999"/>
    <axis rpy="0 0 0" xyz="0 1 0"/>
  </joint>
  <gazebo reference="middle_right_wheel">
    <material>Gazebo/Black</material>
  </gazebo>
  <!-- ............................. 2D LIDAR ........................................ -->
  <link name="two_d_lidar">
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.06" radius="0.075"/>
      </geometry>
    </collision>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.06" radius="0.075"/>
      </geometry>
      <material name="aluminium"/>
    </visual>
    <inertial>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <mass value="0.1"/>
      <inertia ixx="0.000170625" ixy="0" ixz="0" iyy="0.000170625" iyz="0" izz="0.00028125"/>
    </inertial>
  </link>
  <joint name="two_d_lidar_joint" type="fixed">
    <parent link="base_link"/>
    <child link="two_d_lidar"/>
    <origin rpy="0 0 0" xyz="0.0 0 0.08"/>
  </joint>
  <gazebo reference="two_d_lidar">
    <material>Gazebo/White</material>
  </gazebo>
  <!-- ............................. IMU ........................................ -->
  <link name="imu_frame"/>
  <joint name="imu_joint" type="fixed">
    <parent link="base_link"/>
    <child link="imu_frame"/>
    <origin rpy="0.0 0.0 0.0" xyz="0.0 0.0 0.08"/>
  </joint>
  <!-- ............................. CAMERA ........................................ -->
  <!-- KINECT CAMERA -->
  <link name="kinect_camera">
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.07 0.3 0.09"/>
      </geometry>
    </collision>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="meshes/d415.dae"/>
      </geometry>
      <material name="black"/>
    </visual>
    <inertial>
      <mass value="0.01"/>
      <inertia ixx="8.175e-05" ixy="0" ixz="0" iyy="1.0833333333333335e-05" iyz="0" izz="7.908333333333334e-05"/>
    </inertial>
  </link>
  <joint name="kinect_camera_joint" type="fixed">
    <origin rpy="0 0 0" xyz="0.45 0 0.027142857142857142"/>
    <parent link="base_link"/>
    <child link="kinect_camera"/>
  </joint>
  <link name="kinect_camera_optical"/>
  <joint name="kinect_camera_optical_joint" type="fixed">
    <origin rpy="-1.5707963267948966 0 -1.5707963267948966" xyz="0 0 0"/>
    <parent link="kinect_camera"/>
    <child link="kinect_camera_optical"/>
  </joint>
  <!-- .............................STEREO CAMERA ........................................ -->
  <!-- STEREO CAMERA -->
  <link name="stereo_camera">
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.07 0.3 0.09"/>
      </geometry>
    </collision>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="meshes/d415.dae"/>
      </geometry>
      <material name="black"/>
    </visual>
    <inertial>
      <mass value="0.01"/>
      <inertia ixx="8.175e-05" ixy="0" ixz="0" iyy="1.0833333333333335e-05" iyz="0" izz="7.908333333333334e-05"/>
    </inertial>
  </link>
  <joint name="stereo_camera_joint" type="fixed">
    <origin rpy="0 0 0" xyz="0.45 0 0.027142857142857142"/>
    <parent link="base_link"/>
    <child link="stereo_camera"/>
  </joint>
  <link name="stereo_camera_optical"/>
  <joint name="stereo_camera_optical_joint" type="fixed">
    <origin rpy="-1.5707963267948966 0 -1.5707963267948966" xyz="0 0 0"/>
    <parent link="stereo_camera"/>
    <child link="stereo_camera_optical"/>
  </joint>
  <!-- ............................. ROOF ........................................ -->
  <link name="roof_link">
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.9 0.64 0.015"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.030018749999999997" ixy="0" ixz="0" iyy="0.08335208333333333" iyz="0" izz="0.11333333333333333"/>
    </inertial>
  </link>
  <joint name="roof joint" type="fixed">
    <parent link="chassis_link"/>
    <child link="roof_link"/>
    <origin rpy="0 0 0" xyz="0 0 0.16"/>
  </joint>
  <!-- ............................. CONVEYOR ........................................ -->
  <!-- ............................................................................... -->
</robot>
