@Ingo_Lutkebohle can you clarify how a ready-set is different from a waitset?
I get the point that if you use DDS waitsets there’s an “impedance mismatch” with ROS 2 waitsets, and that hurts performance.
But if the API of a ready-set is going to be the following:
attachmethods to add entities.detachmethods to remove entities.waitmethod. This can return only the “ready handles”, so you don’t have to iterate over all.
The “ready handles” can be pre-allocated and bounded (as you now how many entities were attached).
It sounds like it’s exactly the same (conceptually) to a waitset, but avoiding the performance issues of using DDS waitsets behind the scenes.
Is my understanding of that proposal right?
If that’s the case, I think that having first class support for listeners in rmw and instead implementing “waitsets” (or “ready sets”) on top of that API in an upper layer would be a good idea.
It not only avoids the performance issues, but it also makes the rmw API simpler avoiding the burden added to rmw vendors that don’t have a waitset implementation (see rmw_fastrtps),
I think it’s good to differentiate the three different issues we’re discussing:
- How timers are handled?
- Up to now, only the performance issue was mentioned, but that’s not the only issue of the current timers approach.
Timers aren’t working with simulated time and RTF > 1.
It’s much easier to handle that case from a custom timers thread.
You can use an “event” mechanism to notify that a timer is ready if you don’t want to handle directly the work in the timers thread.
- Up to now, only the performance issue was mentioned, but that’s not the only issue of the current timers approach.
- Performance, the two main issues seem to be:
- Rebuilding wait sets in each iteration.
- Timers
- Determinism of the execution
I think that not using DDS waitsets, but rather having a listener interface as proposed https://github.com/ros2/rmw/pull/286 will allow implementing executors with better performance.
After that is added, there are a lot of different ways to handle execution with different trade-offs between performance and determinism (event queue, work queue, ready-sets, and small variants of them).
I don’t have any execution model preference, I would just pick one (with a preference to the ones that respect the DDS QoS contracts better).
IMO, the only important thing is to add an rmw API that is flexible enough to implement any of the models on top of it, and the current proposal seems to achieve that.