ROS2 Control Demos
This repository provides templates for the development of ros2_control
-enabled robots and a simple simulation of a robot to demonstrate and prove ros2_control
concepts.
Goals
The repository has two goals:
- It provides templates for faster start of implementing own hardware and controllers;
- The repository is a validation environment for
ros2_control
concepts, which can only be tested during run-time (e.g., execution of controllers by the controller manager, communication between robot hardware and controllers).
Description
The repository is inspired by ros_control_boilerplate repository from Dave Coleman. The simulation has three parts/packages:
- The first package,
ros2_control_demo_communication_headless
, uses scripts to simulate communication to and movements of virtual hardware. This package does not have any dependencies except on theros2
core packages and can, therefore, be used on SoC-hardware of headless systems. - The second package,
ros2_control_demo_communication_gazebo
, uses a gazebo simulator to simulate the RRBot and its physics. This package is useful to test the connection ofros2_control
to the gazebo simulator and to detect any missing plugins. - The third package holds template/example files for
ros2_control
enabled robots and controllers. The intention of those files is to simplify start withros2_control
and to enable faster integration of new robots and controllers.
This repository demonstrates the following ros2_control
concepts:
- Creating of
hardware_interface
for a Robot, Sensor, and Actor - Creating a robot description in the form of YAML files
- Loading configuration and starting robot using launch files
- Control of two joints of RRBot
- Using simulated robots and starting
ros_control
with gazebo simulator - Implementing of controller switching strategy for a robot
- Using joint limits and transmission concepts in
ros2_control
- TBD
Getting Started with ROS2 Control
To test demo_robot
start launch file with:
ros2 launch ros2_control_demo_robot demo_robot_launch.py
for headless version of the demo_robot
or
ros2 launch ros2_control_demo_robot demo_robot_modular_launch.py
for headless modular version of the demo_robot
which uses separate interfaces for its sensors and actuators.
demo_robot
Class Diagram of The figure hereunder depicts the class diagram of ros2_control_demos
metapackage, i.e., demo_robot
, together with used interfaces and classes from ros2_control
package.
Diagram gives an overview of the components needed for a robot that is ROS2-Control compatible.
In the middle of the diagram (no color), entities are core components of ros2_control
.
Green colored entities are "ROS2-Control"-standardized data structures, hardware representations, and communication interfaces.
Blue colored is the implementation of demo_robot
.
A large amount of classes is for the exemplary purpose, therefore don't worry you probably don't need so many different interfaces and classes.
Making a Robot for ROS2-Control Compatible
Before starting the implementation of your robot, please check the following diagram: