How ros-controls/ros2_controllers works
ros2_controllers is a ROS 2 package collection of reusable ros2_control controllers and state broadcasters. A typical workflow accepts a ROS command or action, computes joint-level commands, and writes them through ros2_control interfaces to robot hardware; broadcasters expose hardware state back to ROS. The graph preserves major mobile-base, joint-motion, auxiliary-control, sensing, and operator-UI capabilities. Source excerpts are partial, so links between unsampled components are omitted where their runtime wiring cannot be verified.
Main entry points: joint_trajectory_controller.cpp Joint trajectories · diff_drive_controller.cpp Diff drive · mecanum_drive_controller.cpp Mecanum drive · omni_wheel_drive_controller.cpp Omni wheel drive
Components 21
Mobile bases
- Diff drive
diff_drive_controller/src/diff_drive_controller.cpp - Mecanum drive
mecanum_drive_controller/src/mecanum_drive_controller.cpp - Omni wheel drive
omni_wheel_drive_controller/src/omni_wheel_drive_controller.cpp - Tricycle drive
tricycle_controller/src/tricycle_controller.cpp - Steering controllers
steering_controllers_library/src/steering_controllers_library.cpp
Joint motion
- Joint trajectories
joint_trajectory_controller/src/joint_trajectory_controller.cpp - Gripper actions
parallel_gripper_controller/include/parallel_gripper_controller/parallel_gripper_action_controller_impl.hpp - PID control
pid_controller/src/pid_controller.cpp - Admittance control
admittance_controller/src/admittance_controller.cpp - Motion primitives
motion_primitives_controllers/src/motion_primitives_forward_controller.cpp
State and sensing
- Joint states
joint_state_broadcaster/src/joint_state_broadcaster.cpp - Sensor broadcasters
imu_sensor_broadcaster/src/imu_sensor_broadcaster.cpp - Force torque
force_torque_sensor_broadcaster/src/force_torque_sensor_broadcaster.cpp - Other state broadcasters
state_interfaces_broadcaster/src/state_interfaces_broadcaster.cpp
Auxiliary control
- Forward commands
forward_command_controller/src/forward_command_controller.cpp - GPIO commands
gpio_controllers/src/gpio_command_controller.cpp
Operator tools
- Trajectory UI
rqt_joint_trajectory_controller/rqt_joint_trajectory_controller/joint_trajectory_controller.py
Other components
- ROS clients
- Robot hardware
- Base velocity command
- ROS state topics
Connections 38
- ROS clients → Base velocity command: sends commands
- Base velocity command → Diff drive: subscribes
- Base velocity command → Mecanum drive: subscribes
- Base velocity command → Omni wheel drive: subscribes
- Base velocity command → Tricycle drive: subscribes
- Diff drive → Robot hardware: writes wheel commands
- Mecanum drive → Robot hardware: writes wheel commands
- Omni wheel drive → Robot hardware: writes wheel commands
- Tricycle drive → Robot hardware: writes joint commands
- ROS clients → Joint trajectories: sends trajectories
- Trajectory UI → Joint trajectories: publishes trajectories
- Joint trajectories → Robot hardware: writes joint commands
- ROS clients → Gripper actions: sends action goals
- Gripper actions → Robot hardware: writes gripper commands
- ROS clients → PID control: sends references
- PID control → Robot hardware: writes commands
- ROS clients → Admittance control: sends references
- Admittance control → Robot hardware: writes commands
- ROS clients → Motion primitives: sends action goals
- Motion primitives → Robot hardware: writes motion commands
- ROS clients → Forward commands: sends commands
- Forward commands → Robot hardware: writes interfaces
- ROS clients → GPIO commands: sends commands
- GPIO commands → Robot hardware: writes GPIO interfaces
- Robot hardware → Joint states: provides joint state
- Robot hardware → Sensor broadcasters: provides sensor state
- Robot hardware → Force torque: provides wrench state
- Robot hardware → Other state broadcasters: provides interface state
- Joint states → ROS state topics: publishes
- Sensor broadcasters → ROS state topics: publishes
- Force torque → ROS state topics: publishes
- Other state broadcasters → ROS state topics: publishes
- Robot hardware → Diff drive: supplies wheel feedback
- Robot hardware → Mecanum drive: supplies wheel feedback
- Robot hardware → Omni wheel drive: supplies wheel feedback
- Robot hardware → Tricycle drive: supplies joint feedback
- Robot hardware → Joint trajectories: supplies joint state
- Robot hardware → Gripper actions: supplies joint state