This repository contains a C++ implementation of the EventsExecutor
designed by iRobot.
It is a new type of executor compatible with the ROS 2 rclcpp
library.
The EventsExecutor
design is based on the following principles:
- You don't pay for what you don't use.
- The abstractions between the application and the RMW should have minimal overhead.
- Extensibility.
The following data have been measured using the iRobot ros2-performance framework and show how, for a 10 nodes system, the EventsExecutor
reduces both CPU and latency by 75% with respect to the default SingleThreadedExecutor
and by 50% with respect to the StaticSingleThreadedExecutor
.
These results have been obtained using the default implementation of the EventsExecutor
events queue, i.e. an std::queue
.
The extensibility of the EventsExecutor
comes from the fact that this core components can be re-implemented by the users.
For example in this repository we also include an extension that uses a lock-free queue, based on this great concurrent queue implementation.
Other extensions would allow to bound the queue or enforce deterministic execution constraints.
This repository provides libraries that can be built/installed alongside a standard ROS 2 installation and give access to the EventsExecutor
class and its related components.
To use the EventsExecutor
you just need to build the irobot_events_executor
project and add it as a dependency in your application.
The irobot_lock_free_events_queue
is an optional package that provides access to a more performant implementation of the EventsExecutor
events queue.
It also serves as an example of how the EventsExecutor
can be customized and extended.
The repository contains some example applications showing how to use the EventsExecutor
in your application.
To build and run the examples you can do the following:
docker run -it osrf/ros:humble-desktop bash
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install ros-humble-test-msgs
mkdir -p /root/ws/src
cd /root/ws/src
git clone https://github.com/irobot-ros/events-executor.git
cd ..
colcon build
source install/setup.sh
ros2 run events_executor_examples hello_events_executor
List of Pull Requests that are introducing the EventsExecutor
in the ROS 2 core repositories.
- ros2/rclcpp#1579
- ros2/rcl#839
- ros2/rmw#286
- ros2/rmw_connextdds#44
- ros2/rmw_cyclonedds#256
- ros2/rmw_fastrtps#468
- ros2/rmw_implementation#161
- The
EventsExecutor
is not notified when a ROS 2 timer is reset.