ROS 2 and Real-Time
This is the list of steps that would be needed to be done to make ROS 2 real-time. The list is WIP and needs additional text to explain the rationale, current state and a possible solution.
- Pick RT capable HW. Decide if we go multi-core many-core or microP.
- RTOS (real time operation system). Decide if we go posix or not posix. Add adaptive partitioning scheduler.
- Create/Get BSP (board support package) and do modifications (e.g. patch RT PREEMPT for Linux, configure the kernel (e.g. isolate CPUs, remove all unwanted drivers, add other applications))
- Explore use of RT hyper-visor (QNX has one)
- Use/create static and real-time middleware
- rmw, rcl, rclcpp layers:
- safe data types (bounded, check type integrity)
- memory audit (remove unneeded memory allocations)
- split memory allocation in init and runtime phases, avoid memory fragmentation
- remove all blocking calls (or replace with timed calls, e.g.
- implement real-time safe log output handler (no console, no files)
- implement real-time pub/sub (either using Waitset or modified Callback/Executor)
- convert ros2 launch to C++
- run tools for static and dynamic code analysis (PCLint, LDRA, Silexica, LTT-ng)
- Check everything above in STL library
- Node architecture for deterministic execution (policy for message aggregation, nodes cohesion, parallelization, ...)
- Global error handling (history of failures, core dumps, fail-safe mechanism, ...)
- Real-time safety for higher level concepts, e.g.:
- Create reference applications and porting guidelines from ROS1 to ROS2
- Create CI for RT testing (e.g. https://github.com/ros2/ros2/issues/607#issuecomment-460319513)