Gazebo and ROS assumptions

As we know, Gazebo is a physics simulation engine with ROS support. It works as a standalone without ROS as well. Most models that are created in Gazebo are in an XML format called Simulation Description Format (SDF). ROS has a different approach to representing robot models. They are defined in an XML format called Universal Robotic Description Format (URDF). So, there is nothing to worry about here because, if the models are created in URDF, with some extra XML tags, they could be easily understood by Gazebo as they're converted automatically into SDF (because of those extra XML tags) under its hood. But if the models are defined in SDF, porting some of the robot's ROS-based features might be a bit tricky.

There is support for a variety of SDF-based plugins that work or provide message information to ROS, but they're limited to few sensors and controllers. We have Gazebo-9 installed alongside our ROS-1 Melodic Morenia. Although we have the latest Gazebo and ROS versions (at the time of writing this book), most ros_controllers are still not supported in SDF and we need to create custom controllers to make them work. Hence, we shall create robot models in URDF format and spawn it into Gazebo and allow the Gazebo's built-in APIs (URDF2SDF: http://osrf-distributions.s3.amazonaws.com/sdformat/api/6.0.0/classsdf_1_1URDF2SDF.html) do the job of conversion for us.

To achieve ROS integration with Gazebo, we need certain dependencies that would establish a connection between both and convert the ROS messages into Gazebo-understandable information. We also need a framework that implements real-time-like robot controllers that help the robot move kinematically. The former constitutes the gazebo_ros_pkgs package, which is a bunch of ROS wrappers written to help Gazebo understand the ROS messages and services, and while latter constitutes the ros_control and ros_controller packages, which provide robot joint and actuator space conversions and ready-made controllers that control position, velocity, or effort (force). You can install them through these commands:

$ sudo apt-get install ros-melodic-ros-control
$ sudo apt-get install ros-melodic-ros-controllers
$ sudo apt-get install ros-melodic-Gazebo-ros-control

We will be using the hardware_interface::RobotHW class from ros_control as it already has defined abstraction layers and joint_trajectory_controller and diff_drive_controller from ros_controllers for our robot arm and mobile base, respectively.

More information about ros_control and ros_controllers can be found in this article: http://www.theoj.org/joss-papers/joss.00456/10.21105.joss.00456.pdf.

Now that we know the basics of building mobile manipulators, let's start building the robot base.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.203.68