No version for distro humble. Known supported distros are highlighted in the buttons above.
No version for distro jazzy. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.
![]() |
ros2-realtime-examples repositoryreal-time cpp realtime ros ros2 rclcpp minimal_cpu_affinity minimal_memory_lock minimal_scheduling |
|
Repository Summary
Description | Minimal ROS 2 real-time cookbook recipes |
Checkout URI | https://github.com/ros-realtime/ros2-realtime-examples.git |
VCS Type | git |
VCS Version | rolling |
Last Updated | 2023-06-05 |
Dev Status | UNKNOWN |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | real-time cpp realtime ros ros2 rclcpp |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
minimal_cpu_affinity | 0.0.1 |
minimal_memory_lock | 0.0.1 |
minimal_scheduling | 0.0.1 |
README
Minimal ROS 2 real-time cookbook recipes
Collection of ROS 2 minimal examples showing how to leverage different POSIX and ROS 2 features to create real-time applications.
- minimal_memory_lock: shows how to lock the process memory to avoid memory page faults
- minimal_scheduling: shows how to configure the thread(s) scheduling policy and priority
- minimal_cpu_affinity: shows how to set the process and threads CPU affinity
TODO: Add other packages after review (currently in rolling-experimental branch):
- minimal_realtime_loop: shows different approaches to created typical real-time time based loops
- minimal_deadline_qos: shows how to use the DDS deadline QoS policy
- minimal_lifecycle: shows how to use node lifecycle to separate configuration and runtime real-time phases
- minimal_memory_check: shows how use verify that functions used in the real-time path does not allocate dynamic memory
- minimal_memory_allocator: shows how to use different memory strategies to avoid dynamic memory allocations during the runtime phase
- minimal_loaned_messages: shows how to use loaned messages APIs
- minimal_data_sharing: shows how to use different data sharing approached to avoid blocking calls when sharing data between real-time and non real-time threads
- minimal_dds_tuning: shows how to use DDS specific configurations to tune real-time related settings (TODO: add XML profiles for more DDS implementations)
Requirements
- ROS 2 rolling release
- Linux based operating system (RT_PREEMPT is not mandatory to run the examples)
- Privileges to set priority, scheduling and memory lock limits. This can be achieved by having
root privileges or adding user privileges to
/etc/security/limits.conf
Build instructions
Create workspace
$ mkdir -p ros2_realtime_examples_ws/src
$ cd ros2_realtime_examples_ws/src
$ git clone https://github.com/ros-realtime/ros2-realtime-examples.git
# Optional: Build rmw_iceoryx for zero-copy examples
$ git clone https://github.com/ros2/rmw_iceoryx
Install dependencies
Use rosdep to install the required dependencies:
$ cd ros2_realtime_examples_ws
$ rosdep install --from-paths src/ --ignore-src --rosdistro=rolling
Build
Build examples
$ cd ros2_realtime_examples_ws
$ colcon build
Note: Some examples might require to install additional RMW implementations
CONTRIBUTING
No CONTRIBUTING.md found.
No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro iron. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.