Intro

The ros2_control is a framework for (real-time) control of robots using ROS2. It’s packages are a rewrite of ros_control packages used in ROS

ros2_control flow

/cmd_vel  →  diff_drive_controller  →    hardware interface (write())  →  serial or PWM

                          ↑      controller manager          ↓

                joint_state_broadcaster  ←  hardware interface (read())  ←  encoders

ros_control

https://wiki.ros.org/ros_control

description

The ros_control packages takes as input the joint state data from your robot’s actuator’s encoders and an input set point. It uses a generic control loop feedback mechanism, typically a PID controller, to control the output, typically effort, sent to your actuators. ros_control gets more complicated for physical mechanisms that do not have one-to-one mappings of joint positions, efforts, etc but these scenarios are accounted for using transmissions.

ros2_control packages

📦 ros2_control - the main interfaces and components of the framework;

  • ros2_controllers- widely used controllers, such as forward command controller, joint trajectory controller, differential drive controller;
  • control_toolbox - some widely-used control theory implementations (e.g. PID) used by controllers;
  • realtime_tools - general toolkit for realtime support, e.g., realtime buffers and publishers;
  • control_msgs - common messages;
  • kinematics_interface - for using C++ kinematics frameworks;
  • gz_ros2_control - Plugin for Gazebo;
  • topic_based_hardware_interfaces - hardware_interfaces for simulators and other hardware that only support ROS topic-based communication;