Interfacing with simulated controllers using Gazebo
A crucial aspect of robot simulations is accurately replicating real-world conditions, including modeling control interfaces. The ros2_control
framework enables simulating robot controllers to interact with simulated hardware. This section covers integrating ros2_control
with Gazebo, starting with creating a robot model containing ros2_control
plugins to move the robot’s joints. To do this, the following steps must be taken.
Step 1 – Creating the ROS 2 package
The first step to include controllers in a simulated robot is to obtain the simulation model. We already discussed the 3D simulation models of robots and showed how to create them and import them in simulation software such as Gazebo in Chapters 4 and 5 of this book. Let’s create a package containing the necessary files to simulate a robot with two joints: a revolute one and a prismatic one. Move into the source folder of your ROS 2 workspace and...