The ros2_control framework is a realtime control framework designed for general robotics applications that gains more and more attention both for research and industrial purposes. An overview of the ros2_control framework can be found here.
This tutorial is made to understand the basic concepts of controlling a robot using ros2_control. In particular, it describes how to :
- Write a URDF description of a simple SCARA manipulator
- Launch and interact with the SCARA robot
- Write a custom hardware interface for the SCARA robot
- Write a custom controller for the SCARA robot
- Set up the SCARA manipulator to run with ros2_control and Gazebo
Required setup : Ubuntu 22.04 LTS and ROS2 Humble
- Install
ros2
packages. The current development is based ofros2 humble
. Installation steps are described here. - Source your
ros2
environment:NOTE: The ros2 environment needs to be sources in every used terminal. If only one distribution of ros2 is used, it can be added to thesource /opt/ros/humble/setup.bash
~/.bashrc
file. - Install
colcon
and its extensions :sudo apt install python3-colcon-common-extensions
- Create a new ros2 workspace:
mkdir ~/ros2_ws/src/
- Pull relevant packages, install dependencies, compile, and source the workspace by using:
cd ~/ros2_ws git clone https://github.com/yguel/scara_tutorial_ros2.git src/scara_tutorial_ros2 rosdep install --ignore-src --from-paths . -y -r colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --symlink-install source install/setup.bash
This tutorial is partially inspired from pac48's tutorial and the official ros2_control website.
This tutorial was created by Maciej Bednarczyk.
ICube Laboratory, University of Strasbourg, France
Manuel YGUEL: yguel @ unistra.fr, @github: yguel