DiffBot Robot Description
The description of the 2WD robot will be created in its own package named
The description uses URDF and xacro.
For this we create a package with
catkin create pkg PKG_NAME [--catkin-deps [DEP [DEP ...]]]:
1 2 3 4 5
Because this package contains only descriptions and launch files it doesn't require any dependencies.
According to ROS conventions we create the following folders where the individual files realted to the robot description will be placed:
urdf folder will be used to keep the
meshes folder keeps the
meshes that are included in the
urdf file, and the
launch folder keeps the ROS launch files.
To model the two wheeled differential drive robot we follow REP-120.
It states to use a
base_link and a
base_footprint. The resulting description files can be found in the
To check a urdf file we can make use of the tools
urdf_to_graphiz in the
liburdfdom-tools debian package.
Install it with the following command:
First we need to convert the robot description of DiffBot, which is present as
xacro file, to a
urdf file by issuing the following command:
After we've created the
urdf from the
xacro file we can check the
urdf files for errors with:
1 2 3 4 5 6 7 8
It is also helpful to output a graphviz diagram of the robot model:
1 2 3 4
To visualize the 3D model in RViz we first need to install the
joint-state-publisher-gui which was separated from non-gui
joint-state-publisher. There exists a debian package which can be installed with the following command:
After installing the required dependency, the
view_diffbot.launch launch file can be executed using
According to the launch file's configuration, this will show the robot in RViz together with the
joint-state-publisher-gui to set the joint values:
With the robot descripton loaded on the ROS parameter server, it's possible to use the
rqt plugin to display the transformation tree (see image above).
URDF in Gazebo