Husarion ROSbot 2 urdf model This page gives you information about the robot model that is used in this project
In this project the urdf model of the Husarion ROSbot 2 is used with the file rosbot.urdf
available here .
This version was created based on the files available at https://github.com/husarion/rosbot_description . These have an MIT licence . These files have been combined and modified to work with ROS2 Foxy and Gazebo Fortress.
The first link of this model is called the base_link
. This is the main body of the robot.
You can notice that some of the links have different files referenced for the visual and for the collision models. The reason behind this is that the simulation uses much less resources if you use a simpler model for the collision than for the visualization.
In the case of this urdf file, the path which indicates the location of the meshes is a so-called absolute path. This gives the location of the file in the entire file system starting from /. In order for rviz to be able to locate the meshes given by an absolute path, the <file location>
section in the <mesh filename="<file location>"
element needs to start with file://
The other links of the model consists of the base_footprint
, imu_link
, top_link
, front_left_wheel
, front_right_wheel
, rear_left_wheel
, rear_right_wheel
, camera_link
, camera_rgb_frame
, camera_depth_frame
and the laser
. These correspond to the footprint of the robot on the ground, the imu sensor, the top cover section, the four wheels, the camera and its frames, and the lidar sensor of the robot, respectively.
These links are connected by joints, in most cases to the base_link
, but in some cases to each other. When a component is supposed to be fixed and unmoving with respect to the component it is attached to, a fixed joint
is used. This is the case for example in case of the top_link
and the base_link
.
When a component is supposed to be moving, however, it is attached by a different type of joint. For example in case of the wheels, they are attached by continuous joint
s to the base_link
.
Copy <?xml version="1.0" ?>
<!-- This file has been created with using the files available at https://github.com/husarion/rosbot_description. These have an MIT licence.
MIT License
Copyright (c) 2018-2020 Husarion Sp. z o.o.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<robot name="husarion_rosbot">
<!--<link name="dummy">-->
<!-- </link>-->
<link name="base_link">
<pose>0 0 0.1 0 0 0</pose>
<inertial>
<mass value="5"/>
<origin rpy=" 0 0 0" xyz="0 0 0.04"/>
<!-- <inertia ixx="0.01" ixy="0.01" ixz="0.0" iyy="0.01" iyz="0.01" izz="0.01"/>-->
<inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.017" iyz="0.0" izz="0.026"/>
</inertial>
<collision name="collision">
<origin rpy="0 0 0" xyz="0 0 0.02"/>
<geometry>
<box size="0.20 0.15 0.04"/>
</geometry>
</collision>
<visual name="base_link_visual">
<origin rpy=" 1.5707 0 1.5707" xyz="0 0 -0.02"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/box.dae" scale="0.001 0.001 0.001"/>
</geometry>
<material name="white">
<color rgba="1.0 1.0 1.0 1.0"/>
</material>
</visual>
</link>
<!-- <joint name="dummy_joint" type="fixed">-->
<!-- <parent link="dummy"/>-->
<!-- <child link="base_link"/>-->
<!-- </joint>-->
<link name="base_footprint"/>
<joint name="base_joint" type="fixed">
<parent link="base_link"/>
<child link="base_footprint"/>
<origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
</joint>
<link name="imu_link"/>
<joint name="imu_joint" type="fixed">
<parent link="base_link"/>
<child link="imu_link"/>
<origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
</joint>
<link name="top_link">
<pose>0 0 0 0 0 0</pose>
<inertial>
<mass value="0.01"/>
<origin rpy=" 0 0 0" xyz="0 0 0.055"/>
<inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0001"/>
</inertial>
<visual name="top">
<origin rpy=" 1.5707 0 1.5707" xyz="0 0 0.055"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/upper.dae" scale="0.001 0.001 0.001"/>
</geometry>
<material name="red">
<color rgba="0.8 0.0 0.0 1.0"/>
</material>
</visual>
<collision>
<geometry>
<box size="0.001 0.001 0.001"/>
</geometry>
</collision>>
</link>
<joint name="top_joint" type="fixed">
<axis xyz="0 1 0"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
<parent link="base_link"/>
<child link="top_link"/>
</joint>
<link name="front_left_wheel">
<collision name="collision">
<origin rpy="0 0 1.5707" xyz="0 0 0"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/wheel_simple.dae" scale="0.001 0.001 0.001"/>
</geometry>
<surface>
<friction>
<ode>
<mu>10</mu>
<mu2>10</mu2>
</ode>
</friction>
</surface>
</collision>
<visual name="front_left_wheel_visual">
<origin rpy="0 0 1.5707" xyz="0 0 0"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/wheel.dae" scale="0.001 0.001 0.001"/>
</geometry>
<material name="black">
<color rgba="0.0 0.0 0.0 1.0"/>
</material>
</visual>
<inertial>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<mass value="0.5"/>
<inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
</inertial>
</link>
<link name="front_right_wheel">
<collision name="collision">
<origin rpy="0 0 -1.5707" xyz="0 0 0"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/wheel_simple.dae" scale="0.001 0.001 0.001"/>
</geometry>
<surface>
<friction>
<ode>
<mu>10</mu>
<mu2>10</mu2>
</ode>
</friction>
</surface>
</collision>
<visual name="front_right_wheel_visual">
<origin rpy="0 0 -1.5707" xyz="0 0 0"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/wheel.dae" scale="0.001 0.001 0.001"/>
</geometry>
<material name="black">
<color rgba="0.0 0.0 0.0 1.0"/>
</material>
</visual>
<inertial>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<mass value="0.5"/>
<inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
</inertial>
</link>
<link name="rear_left_wheel">
<collision name="collision">
<origin rpy="0 0 1.5707" xyz="0 0 0"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/wheel_simple.dae" scale="0.001 0.001 0.001"/>
</geometry>
<surface>
<friction>
<ode>
<mu>10</mu>
<mu2>10</mu2>
</ode>
</friction>
</surface>
</collision>
<visual name="rear_left_wheel_visual">
<origin rpy="0 0 1.5707" xyz="0 0 0"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/wheel.dae" scale="0.001 0.001 0.001"/>
</geometry>
<material name="black">
<color rgba="0.0 0.0 0.0 1.0"/>
</material>
</visual>
<inertial>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<mass value="0.5"/>
<inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
</inertial>
</link>
<link name="rear_right_wheel">
<collision name="collision">
<origin rpy="0 0 -1.5707" xyz="0 0 0"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/wheel_simple.dae" scale="0.001 0.001 0.001"/>
</geometry>
<surface>
<friction>
<ode>
<mu>10</mu>
<mu2>10</mu2>
</ode>
</friction>
</surface>
</collision>
<visual name="rear_right_wheel_visual">
<origin rpy="0 0 -1.5707" xyz="0 0 0"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/wheel.dae" scale="0.001 0.001 0.001"/>
</geometry>
<material name="black">
<color rgba="0.0 0.0 0.0 1.0"/>
</material>
</visual>
<inertial>
<origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
<mass value="0.5"/>
<inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
</inertial>
</link>
<joint name="front_left_wheel_hinge" type="continuous">
<origin rpy="0 0 0" xyz="0.05 0.11 0"/>
<child link="front_left_wheel"/>
<parent link="base_link"/>
<axis rpy="0 0 0" xyz="0 1 0"/>
<!-- <limit effort="5" velocity="50"/>-->
<limit effort="1" velocity="10"/>
<joint_properties damping="5.0" friction="1.0"/>
</joint>
<joint name="front_right_wheel_hinge" type="continuous">
<origin rpy="0 0 0" xyz="0.05 -0.11 0"/>
<child link="front_right_wheel"/>
<parent link="base_link"/>
<axis rpy="0 0 0" xyz="0 1 0"/>
<!-- <limit effort="5" velocity="50"/>-->
<limit effort="1" velocity="10"/>
<joint_properties damping="5.0" friction="1.0"/>
</joint>
<joint name="rear_left_wheel_hinge" type="continuous">
<origin rpy="0 0 0" xyz="-0.055 0.11 0"/>
<child link="rear_left_wheel"/>
<parent link="base_link"/>
<axis rpy="0 0 0" xyz="0 1 0"/>
<!-- <limit effort="5" velocity="50"/>-->
<limit effort="1" velocity="10"/>
<joint_properties damping="5.0" friction="1.0"/>
</joint>
<joint name="rear_right_wheel_hinge" type="continuous">
<origin rpy="0 0 0" xyz="-0.055 -0.11 0"/>
<child link="rear_right_wheel"/>
<parent link="base_link"/>
<axis rpy="0 0 0" xyz="0 1 0"/>
<!-- <limit effort="5" velocity="50"/>-->
<limit effort="1" velocity="10"/>
<joint_properties damping="5.0" friction="1.0"/>
</joint>
<link name="camera_link">
<collision>
<origin rpy="0 0 0" xyz="0.02 0 0"/>
<geometry>
<box size="0.001 0.001 0.001"/>
</geometry>
</collision>
<visual>
<origin rpy="1.5707 0 1.5707" xyz="-0.01 0 -0.03"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/astra.dae" scale="0.001 0.001 0.001"/>
</geometry>
<material name="black">
<color rgba="0.0 0.0 0.0 1.0"/>
</material>
</visual>
<inertial>
<mass value="1e-5"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
</inertial>
</link>
<joint name="astra_joint" type="fixed">
<axis xyz="0 0 0"/>
<origin rpy="0 0 0" xyz="-0.03 0 0.18"/>
<parent link="base_link"/>
<child link="camera_link"/>
</joint>
<link name="camera_rgb_frame">
</link>
<joint name="camera_optical_joint" type="fixed">
<origin rpy="-1.5707963267948966 0 -1.5707963267948966" xyz="0 0 0"/>
<parent link="camera_link"/>
<child link="camera_rgb_frame"/>
</joint>
<link name="camera_depth_frame">
</link>
<joint name="camera_depth_joint" type="fixed">
<origin rpy="-1.5707963267948966 0 -1.5707963267948966" xyz="0 0 0"/>
<parent link="camera_link"/>
<child link="camera_depth_frame"/>
</joint>
<!-- rplidar Laser -->
<link name="laser">
<collision>
<origin rpy="1.5707 0 4.71" xyz="0 0 0.058"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/rplidar_simple.dae" scale="0.001 0.001 0.001"/>
</geometry>
</collision>
<visual>
<origin rpy="1.5707 0 4.71" xyz="0 0 0.058"/>
<geometry>
<mesh filename="file:///ros2_pkgs_ws/src/husarion_rosbot/meshes/rplidar.dae" scale="0.001 0.001 0.001"/>
</geometry>
<material name="black">
<color rgba="0.0 0.0 0.0 1.0"/>
</material>
</visual>
<inertial>
<mass value="1e-5"/>
<origin rpy="1.5707 0 4.71" xyz="0 0 0.058"/>
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
</inertial>
</link>
<joint name="rplidar_joint" type="fixed">
<axis xyz="0 1 0"/>
<origin rpy="0 0 3.14" xyz="0.02 0 0"/>
<parent link="base_link"/>
<child link="laser"/>
</joint>
<gazebo>
<plugin filename="libignition-gazebo-joint-state-publisher-system.so" name="ignition::gazebo::systems::JointStatePublisher">
<topic>/joint_state</topic>
</plugin>
<plugin
filename="ignition-gazebo-diff-drive-system"
name="ignition::gazebo::systems::DiffDrive">
<left_joint>front_left_wheel_hinge</left_joint>
<left_joint>rear_left_wheel_hinge</left_joint>
<right_joint>front_right_wheel_hinge</right_joint>
<right_joint>rear_right_wheel_hinge</right_joint>
<wheel_separation>0.1</wheel_separation>
<wheel_radius>0.04</wheel_radius>
<topic>cmd_vel</topic>
<odom_publish_frequency>20</odom_publish_frequency>
<frame_id>odom</frame_id>
<child_frame_id>base_link</child_frame_id>
</plugin>
</gazebo>
<gazebo reference="laser">
<sensor name="laser" type="gpu_lidar">
<topic>scan</topic>
<frame>laser</frame>
<pose>0 0 0.06 0 0 0</pose>
<visualize>false</visualize>
<update_rate>20</update_rate>
<ray>
<scan>
<horizontal>
<samples>360</samples>
<resolution>1</resolution>
<min_angle>-3.14159265</min_angle>
<max_angle>3.14159265</max_angle>
</horizontal>
</scan>
<range>
<min>0.1</min>
<max>10.0</max>
<resolution>0.01</resolution>
</range>
<noise>
<type>gaussian</type>
<mean>0.0</mean>
<stddev>0.01</stddev>
</noise>
</ray>
</sensor>
</gazebo>
<gazebo reference="imu_link">
<sensor name="imu_sensor" type="imu">
<always_on>true</always_on>
<update_rate>20</update_rate>
<visualize>true</visualize>
<!--<namespace>/demo</namespace>-->
<topic>imu</topic>
<imu>
<angular_velocity>
<x>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>2e-4</stddev>
<bias_mean>0.0000075</bias_mean>
<bias_stddev>0.0000008</bias_stddev>
</noise>
</x>
<y>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>2e-4</stddev>
<bias_mean>0.0000075</bias_mean>
<bias_stddev>0.0000008</bias_stddev>
</noise>
</y>
<z>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>2e-4</stddev>
<bias_mean>0.0000075</bias_mean>
<bias_stddev>0.0000008</bias_stddev>
</noise>
</z>
</angular_velocity>
<linear_acceleration>
<x>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>1.7e-2</stddev>
<bias_mean>0.1</bias_mean>
<bias_stddev>0.001</bias_stddev>
</noise>
</x>
<y>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>1.7e-2</stddev>
<bias_mean>0.1</bias_mean>
<bias_stddev>0.001</bias_stddev>
</noise>
</y>
<z>
<noise type="gaussian">
<mean>0.0</mean>
<stddev>1.7e-2</stddev>
<bias_mean>0.1</bias_mean>
<bias_stddev>0.001</bias_stddev>
</noise>
</z>
</linear_acceleration>
</imu>
</sensor>
</gazebo>
</robot>
In the page before, we have described the phenomena of simulation gap. This simulation gap concerns both the simulation world and the robot's model. In case the world's model or the robot's model and behavior would be made more realistic, the effect of simulation gap would be lessened. However, this is out of the bounds of this project. This is why in this project a ROS2 node was created to update the position and orientation of the robot model inside the simulated world that is available here .
Setting the appropriate QoS policy is very important for this script. It needs to be set to Best effort
, as with the reliable
setting the node transfers messages too slowly. Moreover, it needs to be set to VOLATILE instead of TRANSIENT_LOCAL, otherwise the node does not transmit messages at all.
Last updated 11 months ago