This repository provides experimental real-time extensions for ROS 2.
It extends the ROS 2 Client Libraries with real-time–oriented capabilities, such as configurable thread attributes and scheduling behavior, while abstracting RTOS-specific thread APIs behind a common interface.
The work in this repository is based on the concept proposed in REP-2017.
Originally, real-time–related functionality was planned as an extension to core ROS 2 packages (e.g., rcl, rclcpp).
Community discussions, including feedback from the PTC, concluded that such functionality would be difficult to maintain within the core.
As a result, these capabilities are provided as a separate package set, allowing independent evolution while keeping the ROS 2 core lightweight.
The repository provides experimental real-time extensions for ROS 2, with a focus on thread configuration, scheduling control, and RTOS portability. Basic usage is written in examples_rclcpp_realtime.
- External YAML-based real-time configuration is supported.
- Thread attributes can be applied to Executors at runtime.
- POSIX is used as the initial reference backend.
rcl_realtimebased on rcl/rcl- Introcudes a dedicated context for real-time configuration.
- Provides APIs for loading and accessing real-time settings (e.g., thread attributes).
rcl_realtime_yaml_param_parserbased on rcl/rcl_yaml_param_parser- Implements a YAML-based configuration parser for real-time settings.
- Designed to decouple configuration formats from core logic.
rcutils_realtimebased on rcutils- Introduces common data structures for representing thread attributes (priority, affinity, scheduling policy, etc.).
rclcpp_realtimebased on rclcpp/rclcpp (reference implementation)- Provides a thread-based Executor capable of applying real-time configuration.
- Extends execution behavior based on the real-time context added to
rcl. - Only additional executors
SchedParamSingleThreadedExecutorandSchedParamMultiThreadedExecutorcapable of reading thread attributes
rcpputils_realtimebased on rcpputils- Implements an abstraction layer over OS-specific thread APIs.
- Currently supports POSIX-based APIs only.
- Improve documentation
- Add API documentation (Doxygen)
- Document configuration usage (See README of examples_rclcpp_realtime_executor)
- Executor-option-based configuration
- YAML-based configuration
-
rosparam-based configuration
- Provide sample programs and usage examples
- Expand test coverage
- Add additional API tests
- Verify interoperability between
rclandrclcppAPIs
- Add git history for copied files and improve traceability
- Revise implementation to extend
--ros-args - Separate
rclcppcompatible test workflow - Extend backend support to additional platforms and RTOS environments (e.g., Windows, macOS, QNX, VxWorks, eMCOS POSIX, Zephyr)
- Replace
std::thread,std::mutex, andstd::condition_variablewith implementations that expose and utilizenative_handle - Apply and validate real-time configurations for ROS message communication mechanisms
- Compare implementation details and performance with existing publicly available executors
- Features
- Add example package
exmaple_rclcpp_realtime - Remove unnecessary class
rclcpp_realtime::Node - Implement scheduling-parameter based executors (
SchedParamSingleThreadedExecutor,SchedParamMultiThreadedExecutor) - Restructure API (e.g., add
context_register)
- Add example package
- Bug Fixes
- Handle
--ros-argsargument removal inrcl_realtime::init() - Initialize
rcl_realtime_contextupon adding new entries - Improve compatibility and revise the executor in
rclcpp_realtime - Migrate git history from original ROS core packages
- Handle
- Test
- Add Python tools for testing and implement
BUILD_COMP_TESTINGCMake option - Add
rclcpp_preload_wrapper.hto compatibirity check forrclcpp
- Add Python tools for testing and implement
- Documentation
- Add Doxygen API comments to headers
- Improve
READMEand package documentation - Update "Getting Started" guide in examples
- Features
- Migrate implementation of REP-2017 & sched_param examples
- Implement realtime context, arguments and functions
- Documentation
- Add project documentation (
README, TODOs, and YAML notes) - Add
package.xmland other package metadata
- Add project documentation (
This work was supported by the New Energy and Industrial Technology Development Organization (NEDO), Japan, under commissioned research project JPNP25016.