ROS 2 Control (ros2_control) is a middleware framework that provides a deterministic, real-time abstraction layer between a robot's software controllers and its physical hardware. It defines a standard architecture with three core components: hardware interfaces for direct communication with motors and sensors, controllers (e.g., for position or velocity) that implement control algorithms, and a controller manager that dynamically loads and switches between controllers. This separation allows robotics software engineers to write hardware-agnostic control logic and system integrators to support diverse actuators and sensors through a consistent API.
Glossary
ROS 2 Control (ros2_control)

What is ROS 2 Control (ros2_control)?
ROS 2 Control is the standardized framework within the Robot Operating System 2 (ROS 2) for managing and abstracting robot hardware interfaces and controllers, providing a unified real-time control layer.
The framework is essential for embodied intelligence systems as it enables reliable, low-latency execution of control loops critical for physical actuation. By managing resource contention and enforcing real-time constraints, ros2_control ensures that commands from high-level planners or Reinforcement Learning agents are executed predictably on the hardware. It integrates seamlessly with the broader ROS 2 ecosystem, using ROS 2 Topics and Services for configuration, while its hardware abstraction simplifies Sim-to-Real Transfer and system integration across different robotic platforms.
Core Components of ROS 2 Control
ROS 2 Control is a framework for managing and abstracting robot hardware interfaces (e.g., joints, sensors) and controllers (e.g., position, velocity) to provide a unified real-time control layer. Its architecture is built from several key, interoperable components.
Resource Manager
The Resource Manager is the central authority that owns and arbitrates access to all Hardware Components and their State & Command Interfaces. It enforces strict rules to prevent multiple controllers from writing to the same command interface.
- Core Responsibility: Maintains a global map of all available control interfaces (e.g.,
/joint1/position,/wheel_left/velocity). - Lifecycle: Initializes all hardware components, prepares them for communication, and handles their cleanup.
- Interaction: The Controller Manager requests interface access from the Resource Manager when activating a controller.
Control Interface
A Control Interface is a named, typed channel for data exchange between a Controller and a Hardware Interface. They are the fundamental "wires" over which control signals flow.
- Command Interface: A write-only channel from a controller to hardware (e.g., to set a joint's target position).
- State Interface: A read-only channel from hardware to the system (e.g., to read a joint's actual position or motor current).
- Standard Types:
position,velocity,acceleration,effort(force/torque). - Naming Convention: Follows the pattern
/<component_name>/<interface_type>(e.g.,/arm_joint_3/position).
Hardware Component
A Hardware Component is a concrete implementation of a Hardware Interface that represents a specific piece of physical hardware. It is the leaf node in the abstraction tree, containing the actual driver logic.
- Examples:
- A
GenericSystemcomponent for simulating simple joints. - A
MockSensorcomponent for testing. - A custom
EtherCATDrivecomponent for a specific motor controller.
- A
- Declaration: Defined in a robot's URDF file using
<ros2_control>tags, specifying its type, parameters, and the control interfaces it provides. - Lifecycle: Configured and activated by the Resource Manager on startup.
How ROS 2 Control Works: The Control Loop
The ROS 2 Control framework executes a deterministic, real-time loop that abstracts hardware to provide a unified interface for high-level controllers.
The ROS 2 Control loop is a real-time software pipeline that periodically reads sensor data from hardware interfaces, updates the state of active controllers, and writes computed commands back to actuators. This cycle, managed by the controller manager, runs at a fixed frequency defined by the control period, ensuring deterministic timing for stable robotic operation. The loop's primary function is to decouple the hardware-specific I/O from the algorithmic control logic.
Within each cycle, the resource manager provides synchronized access to joint states and handles. Controllers, such as a joint trajectory controller, compute desired forces or positions based on their internal logic and the current state. These commands are passed through the hardware abstraction layer to the actual motors or sensors. This architecture allows swapping controllers or simulating hardware without altering the core control pipeline.
Primary Use Cases and Applications
ROS 2 Control provides the critical software abstraction layer between high-level robot commands and low-level hardware drivers. Its primary applications center on standardizing and simplifying the development of real-time control systems for diverse robotic platforms.
Unified Hardware Abstraction
ROS 2 Control's core function is to provide a hardware abstraction layer (HAL). It defines a standard interface (hardware_interface) for communicating with diverse physical hardware—motors, sensors, grippers—through a common API. This decouples high-level controllers from the specifics of motor drivers or communication buses (e.g., CAN, EtherCAT).
- System Components: A
RobotHWclass (orSystem/Sensor/Actuatorin ros2_control) manages the low-level read/write cycle. - Real-World Example: A robot arm with Dynamixel servos and a force-torque sensor uses a single
Systemto read joint positions and the sensor state, then write new position commands, all through the standardized interface.
Controller Management & Lifecycle
The framework manages the lifecycle and execution of various controllers—software modules that compute commands (e.g., torque, velocity) for the hardware. The controller_manager is the central orchestrator.
-
Controller Types: It can load, start, stop, and switch between controllers like joint_trajectory_controller for following planned paths, diff_drive_controller for mobile bases, or force_controllers for compliant manipulation.
-
Dynamic Reconfiguration: Controllers can be hot-swapped at runtime. For example, switching from a position controller for precise movement to an impedance controller for safe human interaction.
-
Real-Time Execution: The manager ensures controllers are updated at a deterministic, high-frequency rate (e.g., 1 kHz) critical for stable control.
Simulation Integration (Gazebo/Ignition)
ROS 2 Control is essential for hardware-in-the-loop (HIL) and pure simulation workflows. The ros2_control Gazebo plugin creates a simulated hardware interface, allowing the same controllers and control stack to run identically in simulation and on real hardware.
-
Sim-to-Real Consistency: Developers can design and test complex controller behaviors in a safe, simulated environment using Gazebo or Ignition before deploying to physical robots.
-
Workflow: The plugin bridges the simulation physics engine (providing simulated joint states) and the ROS 2 Control framework, which runs the actual
controller_managerand controllers. This validates the entire software pipeline.
Real-Time Control System Architecture
It enables the design of deterministic, real-time control systems. By separating the non-real-time ROS 2 communication layer from the real-time control loop, it ensures low-latency, jitter-free execution.
-
Dual-Loop Architecture: High-level planning nodes (non-real-time) send goals via actions/topics. The
controller_managerand its loaded controllers (often in a real-time thread or process) execute the tight control loop. -
Use Case: A mobile manipulator uses this architecture. A non-real-time navigation planner sends a base trajectory, while a real-time controller manages wheel velocities and arm joint torques simultaneously, ensuring stable and responsive physical behavior.
Standardized Robot Description & Transmission
ROS 2 Control extends the URDF robot model with control-specific tags (<ros2_control>) to declaratively define hardware interfaces and transmissions.
-
Transmission Modeling: It mathematically maps actuator space (e.g., motor rotation) to joint space (e.g., linear motion of a prismatic joint) using gear ratios and mechanical linkages. A
<transmission>tag in the URDF defines this relationship. -
Declarative Configuration: This allows the system to auto-configure itself from the robot description, reducing boilerplate code. For instance, defining a four-bar linkage or a differential drive transmission here automatically handles the command conversions for the controllers.
Multi-Robot & Modular System Support
The framework supports complex, modular robotic systems, from single arms to heterogeneous fleets.
-
Component-Based Design: Each logical hardware component (e.g., a mobile base, a manipulator arm, a sensor pan-tilt unit) can be modeled as its own
Systemwithin ros2_control, managed by a single or distributedcontroller_manager. -
Fleet Orchestration: In a warehouse, multiple Autonomous Mobile Robots (AMRs) each run their own ROS 2 Control stack. A fleet management system sends high-level goals, while each robot's local control stack handles precise motor control and safety. This separation of concerns is enabled by the abstraction ros2_control provides.
Common Controller Types in ros2_control
A feature and use-case comparison of standard controller implementations provided by the ros2_control framework for managing robot hardware interfaces.
| Controller Type | Primary Use Case | Control Mode | Real-Time Safe | Default Implementation |
|---|---|---|---|---|
Joint State Controller | Broadcast joint states (position, velocity, effort) for other nodes. | Read-only (State Feedback) | joint_state_controller/JointStateController | |
Joint Trajectory Controller | Execute pre-planned trajectories (position, velocity, acceleration). | Forward Command (Position/Velocity) | joint_trajectory_controller/JointTrajectoryController | |
Forward Command Controller | Direct, low-level command forwarding (e.g., velocity, effort). | Forward Command (Velocity/Effort) | forward_command_controller/ForwardCommandController | |
Position Controllers | Closed-loop control to achieve a target joint position. | Feedback Control (Position) | position_controllers/JointGroupPositionController | |
Velocity Controllers | Closed-loop control to achieve a target joint velocity. | Feedback Control (Velocity) | velocity_controllers/JointGroupVelocityController | |
Effort Controllers | Closed-loop control to achieve a target joint torque/effort. | Feedback Control (Effort) | effort_controllers/JointGroupEffortController | |
Diff Drive Controller | Convert twist commands to wheel velocities for differential drive robots. | Forward Command (Velocity) | diff_drive_controller/DiffDriveController | |
IMU Sensor Controller | Broadcast data from an Inertial Measurement Unit (IMU). | Read-only (State Feedback) | imu_sensor_broadcaster/IMUSensorBroadcaster |
Frequently Asked Questions
Essential questions and answers about the ROS 2 Control framework, which provides the critical real-time layer for abstracting robot hardware and managing controllers.
ROS 2 Control is a framework that provides a standardized, real-time capable interface for managing robot hardware resources (joints, sensors) and the software controllers that command them. It works by introducing a clear separation of concerns: a Hardware Abstraction Layer (HAL) provides a uniform API to read from and write to physical hardware (motors, encoders), while a Controller Manager dynamically loads and executes control algorithms (like PID for position control) that compute commands based on sensor feedback and desired setpoints. This architecture allows high-level planning nodes to send trajectory goals without needing direct, non-real-time access to hardware drivers.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
ROS 2 Control is a framework that provides a unified, real-time control layer for robots. It sits at the critical intersection of hardware abstraction, controller management, and system integration. The following terms define its core components and the broader ecosystem it operates within.
Hardware Interface
A Hardware Interface is the software abstraction layer that provides a standardized API for reading from and writing to physical robot hardware components. It acts as the bridge between the generic control commands from ROS 2 controllers and the specific, often proprietary, drivers for motors, sensors, and actuators.
- Types: Common interfaces include
PositionJointInterface,VelocityJointInterface, andEffortJointInterfacefor actuated joints, as well as interfaces for sensors likeJointStateInterfaceandImuSensorInterface. - Implementation: Developers implement these interfaces for their specific hardware, handling the low-level protocol translation (e.g., CAN bus, EtherCAT, PWM signals).
- Role in ros2_control: The hardware resource manager uses these interfaces to claim and command hardware resources, ensuring exclusive access and thread-safe operation for real-time control loops.
Controller Manager
The Controller Manager is the central runtime service in ros2_control responsible for loading, configuring, starting, stopping, and switching between different controllers. It manages the lifecycle of all controllers within the system.
- Dynamic Loading: Controllers are typically loaded as plugins at runtime, allowing for flexible system composition without recompilation.
- Resource Arbitration: It ensures that multiple controllers do not conflict by attempting to command the same hardware interface simultaneously. A controller must 'claim' a hardware resource before it can write to it.
- Real-Time Execution: The manager orchestrates the update loops of loaded controllers, calling their
update()methods at a fixed frequency (e.g., 1 kHz) to compute and forward commands to the hardware interfaces.
Joint Trajectory Controller
A Joint Trajectory Controller is a specific type of ROS 2 controller that executes smooth, time-parameterized motion paths (trajectories) for a set of robot joints. It is one of the most commonly used controllers for robotic arms and other multi-joint systems.
- Input: It subscribes to a
trajectory_msgs/msg/JointTrajectorytopic, which specifies a sequence of target positions, velocities, and accelerations for each joint over time. - Function: The controller uses internal interpolation (e.g., splines) and feedback (from a
JointStateInterface) to compute the instantaneous command (position, velocity, or effort) needed to follow the desired trajectory. - Use Case: Essential for tasks like pick-and-place, where the arm must move through a series of predefined waypoints smoothly and accurately. It abstracts the complex low-level motion generation from the higher-level planning stack.
URDF & SRDF
URDF (Unified Robot Description Format) and SRDF (Semantic Robot Description Format) are XML file formats used to describe a robot's physical and semantic properties, which are foundational for ros2_control configuration.
- URDF: Defines the robot's kinematic tree: links (rigid bodies), joints (connections between links with type, limits, and dynamics), and visual/collision geometry. ros2_control uses URDF to understand the robot's structure and to parse
<ros2_control>tags that declare hardware interfaces and transmission types. - SRDF: Adds semantic information not in the URDF, such as default robot poses, end-effector groups, and most critically for control, virtual joints and passive joints. It helps distinguish between joints controlled by ros2_control and those that are fixed or mimic other joints.
- Integration: Together, they provide a complete static description that the ros2_control system uses to auto-generate much of its configuration and understand resource naming.
Transmission
A Transmission in ros2_control defines the kinematic relationship between an actuator (e.g., a motor) and a joint in the robot model. It maps actuator state/command space (e.g., motor revolutions) to joint space (e.g., radians) and vice-versa.
- Purpose: Abstracts mechanical reductions, non-linear couplings, or complex linkages (e.g., four-bar linkages). It allows controllers to command in intuitive joint space while the hardware interface handles the actuator-specific commands.
- Types: The most common is the
SimpleTransmission, which defines a linear gear ratio. More complex types can be implemented for systems like differential drives or robotic hands with tendon-driven fingers. - Configuration: Defined within the
<ros2_control>tag in the URDF file, linking a specific hardware interface (actuator) to a specific joint.
Real-Time Code & RCLCPP
Real-Time Code refers to software whose execution timing must be deterministic and guaranteed to meet strict deadlines, a critical requirement for low-level robot control. rclcpp is the ROS 2 Client Library for C++, which must be used carefully in real-time contexts.
- Challenge: Standard ROS 2 communication (via
rclcpp::Node) and memory allocation (e.g.,std::vectorresizing) are non-deterministic and can cause deadline misses, leading to jerky or unstable robot motion. - Best Practices:
- Use the
RealtimeNodeclass fromrealtime_toolsas a base, which provides real-time-safe publishers. - Pre-allocate all memory (messages, vectors) during initialization.
- Avoid dynamic memory allocation in the control loop.
- Use a real-time priority scheduler (e.g.,
SCHED_FIFOon Linux) for the control thread.
- Use the
- ros2_control Design: The framework is built to facilitate this by isolating the real-time critical update loop (in controllers and hardware interfaces) from non-real-time management tasks (in the controller manager).

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us