Utilize rclcpp::WaitSet as part of the executors - #2142
Conversation
commented
Mar 28, 2023
|
@mjcarroll I looked into the new entities collection and collector classes and they look great. I think that there are very few changes needed in order to use them with the events-executor:
|
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
b74b192 to
ad3f3e5
Compare
Signed-off-by: Michael Carroll <[email protected]>
* Add callback to EntitiesCollector constructor * Make function to check automatically added callback groups take a list Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
ad3f3e5 to
14e009e
Compare
4191445 to
ed791d3
Compare
Also change node's get_guard_condition to return shared_ptr Signed-off-by: Michael Carroll <[email protected]>
Check if guard condition is valid before adding it to the waitable Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
ed791d3 to
974e845
Compare
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
commented
Apr 24, 2024
|
hey @wjwwood , I was just in a roscontrol WG meeting where @christophfroehlich mentioned a regression that they've seen only in rolling testing build. they're manually building a waitset around a subscription, which maybe is a bit of a niche case, but wanted to flag it for triaging before the next sync is planned - it might not be possible to have a subscription in two wait sets after the changes in this PR? |
commented
Apr 24, 2024
|
Thanks for pinging this here. It is already failing on main, I think this change here was released already. |
commented
Apr 25, 2024
|
ok - although I have a new thought - maybe now the intended behaviour is being enforced! The exception "subscription already associated with a wait set" might mean that it was never appropriate to have it in two wait sets 😅 |
commented
Apr 25, 2024
No, we cannot add the subscription to different wait set after this change. there is a test case to expect the exception, rclcpp/rclcpp/test/rclcpp/node_interfaces/test_node_topics.cpp Lines 165 to 167 in de666d2 CC: @wjwwood @mjcarroll |
commented
Apr 25, 2024
Sorry, just catching up on this, yes indeed that is the case. Technically the constraint is that you cannot wait on one subscription from two different wait sets simultaneously, but we enforce that by not allowing a single subscription to be contained in/associated with more than one wait set at a time. |
If you want to use a subscription with a wait set manually (and that is totally ok to do), then you need to make sure the subscription is not part of a callback group that was added to an executor. You can do that by creating a callback group that has the rclcpp/rclcpp/include/rclcpp/node.hpp Line 151 in de666d2 |
commented
Apr 26, 2024
|
oo hadn't noticed that before; awesome! thanks for the pointers! |
Improve number of
rcl_wait_setcreations and deletions by making the default Single/Multithreaded executors work like the static single threaded executor in terms of entity collection rebuilding.TODOS