This document describes the different software components used by the MoveIt 2, ROS 2 and Gazebo demo, where to find them and how they are being called.
This example and documentation use the name "Gazebo" to refer to the new generation of the Gazebo simulator not be confused with Gazebo classic, the latest version of which is Gazebo 11. The current "Gazebo" was formerly known as Ignition Gazebo, so the document contains some references to "ign_" or "ignition", like in the name of the repository.
The Ignition Gazebo project was renamed to just
Gazebo or Gz, so the document contains some references to the new URLs
and names, like the ones for
gz_ros2_control
,
which should not be confused with
gazebo_ros2_control
,
the ros2_control
wrapper for the previous Gazebo classic.
Note: only the Follow Target example is used in this document
The document details:
- Code repositories being used in the demo
- How to prepare a Robot URDF for using
Gazebo
withros2_control
- How to connect
MoveIt 2
with theGazebo
ros2_control
plugins - How this example declares the target pose for the manipulation
- Other important ROS 2 packages for the simulation
- Graph of runtime ROS 2 topics and nodes
Repositories used:
-
Panda Ign MoveIt 2: Software packages for Franka Emika Panda Robot that enable manipulation with MoveIt 2 inside Gazebo. For control, ign_ros2_control is used.
-
ROS Gazebo This repository holds packages that provide integration between ROS and Gazebo. Mainly
ros_ign_package
is being used to launch Gazebo with ROS 2 integration andros_ign_bridge
to convert Gz messages to ROS messages. -
Gz ROS 2 Control for the latest Gazebo (not to be confused with Gazebo ROS 2 Control for Gazebo-classic!) This is a ROS 2 package for integrating the
ros2_control
controller architecture with theGazebo
simulator.
Two main actions need to be done to prepare the URDF model to use Gazebo
and
ros2_control
: configure ros2_control
setting using the ros2_control
URDF
macro, and add a plugin to Gazebo
to parse the ros2_control
tags and
load the appropriate hardware interfaces and controller manager.
1. URDF declaration for the ros2_control
URDF tag
This is done by adding the xacro macro ros2_control_panda_arm
(which is
integrated from main Panda arm URDF file) and using the
gz_ros2_control/IgnitionSystem
:
2. URDF declaration for the Gazebo plugin IgnitionROS2ControlPlugin
This is done by adding the xacro macro gz_ros2_control
(which is integrated
from main Panda URDF file) and adding the Gazebo plugin IgnitionROS2ControlPlugin
that parses the ros2_control
tags and loads the appropriate hardware interfaces and controller manager
The example launches MoveIt using gz_ros2_control:
This snippet is calling the main Panda MoveIt configuration launch file:
-
Panda main MoveIt 2 move_group invocation:
-
Controller manager
This repository uses a Gazebo PosePublisher
plugin to indicate the target pose for the manipulation:
Translate the pose from Gazebo to ROS using the ros_gz_bridge
:
The /target_pose
topic is subscribed to by the ROS C++ node that communicates with MoveIt
The Robot State Publisher is a node and a class to publish
the state of a robot to tf2
. At startup time, Robot State Publisher is
supplied with a kinematic tree model (URDF) of the robot. It then subscribes
to the joint_states
topic (of type sensor_msgs/msg/JointState
) to get
individual joint states. More information in the
ROS 2 tutorial
tf2
is the second generation of the transform library, which lets the user
keep track of multiple coordinate frames over time. tf2
maintains the
relationship between coordinate frames in a tree structure buffered in
time, and lets the user transform points, vectors, etc between any
two coordinate frames at any desired point in time.
Color legend for nodes:
- Green: Gazebo special nodes for ROS integration
- Purple: pose target created by the example code in this repo
- Blue: nodes created and handled by
ros2_control
invoked fromgz_ros_control
- Yellow:
moveit2
nodes - Red: other ROS 2 important nodes usually needed for simulations