Skip to content

Latest commit

 

History

History
136 lines (91 loc) · 7.18 KB

README.md

File metadata and controls

136 lines (91 loc) · 7.18 KB

Example documentation

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:

  1. Code repositories being used in the demo
  2. How to prepare a Robot URDF for using Gazebo with ros2_control
  3. How to connect MoveIt 2 with the Gazebo ros2_control plugins
  4. How this example declares the target pose for the manipulation
  5. Other important ROS 2 packages for the simulation
  6. Graph of runtime ROS 2 topics and nodes

Code repositories used in the demo

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 and ros_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 the Gazebo simulator.

How to prepare a Robot URDF for using Gazebo with ros2_control

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

How to connect MoveIt 2 with the Gazebo ros2_control plugins

The example launches MoveIt using gz_ros2_control:

This snippet is calling the main Panda MoveIt configuration launch file:

How the Follow Target example declares the target pose for the manipulation

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

Other important ROS 2 packages

Robot state publisher

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

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.

ROS 2 Topics and Nodes

ROS 2 Graph of the demo

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 from gz_ros_control
  • Yellow: moveit2 nodes
  • Red: other ROS 2 important nodes usually needed for simulations