feat: Added callback group events executor#3097
feat: Added callback group events executor#3097jmachowinski wants to merge 16 commits intoros2:rollingfrom
Conversation
273c322 to
66467b3
Compare
rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp
Show resolved
Hide resolved
rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp
Show resolved
Hide resolved
rclcpp/include/rclcpp/experimental/executors/events_cbg_executor/events_cbg_executor.hpp
Outdated
Show resolved
Hide resolved
rclcpp/include/rclcpp/experimental/executors/events_cbg_executor/events_cbg_executor.hpp
Outdated
Show resolved
Hide resolved
rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp
Outdated
Show resolved
Hide resolved
rclcpp/src/rclcpp/executors/events_cbg_executor/events_cbg_executor.cpp
Outdated
Show resolved
Hide resolved
rclcpp/src/rclcpp/experimental/executors/events_cbg_executor/events_cbg_executor.cpp
Outdated
Show resolved
Hide resolved
|
@jmachowinski can you add this to the executor unit-tests? |
26fd9db to
430c2dd
Compare
|
Pulls: #3097 |
skyegalaxy
left a comment
There was a problem hiding this comment.
Aside from some spelling nits and a handful of small implementation questions, this is looking great! Very excited to get this over the finish line soon.
rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp
Outdated
Show resolved
Hide resolved
| added_nodes_cpy = added_nodes; | ||
| } | ||
|
|
||
| // *3 is a rough estimate of how many callback_group a node may have |
There was a problem hiding this comment.
What would happen in the case where a node might have more than 3 callback groups?
There was a problem hiding this comment.
you get slight runtime overhead, as the vector needs to be resized.
| } | ||
| } | ||
|
|
||
| // FIXME inform scheduler about remove cbgs |
There was a problem hiding this comment.
what are the side-effects of leaving this as is and not informing the scheduler here?
rclcpp/src/rclcpp/executors/events_cbg_executor/events_cbg_executor.cpp
Outdated
Show resolved
Hide resolved
rclcpp/src/rclcpp/executors/events_cbg_executor/events_cbg_executor.cpp
Outdated
Show resolved
Hide resolved
rclcpp/src/rclcpp/executors/events_cbg_executor/timer_manager.hpp
Outdated
Show resolved
Hide resolved
yes, that is the idea. |
rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp
Outdated
Show resolved
Hide resolved
rclcpp/include/rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp
Outdated
Show resolved
Hide resolved
rclcpp/src/rclcpp/executors/events_cbg_executor/timer_manager.hpp
Outdated
Show resolved
Hide resolved
|
|
||
| // as, we remove an reappend ready callback_groups during execution, | ||
| // the first ready cbg may not contain the lowest id. Therefore we | ||
| // need to search the whole deque |
There was a problem hiding this comment.
Not a blocker for this PR, but I think it would be interesting to see if we could find a way to efficiently index ready_callback_groups by ID as well as the order, so that instead of searching through the entire deque, we could do something like ready_callback_groups.pop_by_id(max_id)
|
@jmachowinski we also need DCO for some of the newer commits |
dab768c to
b7e95f7
Compare
skyegalaxy
left a comment
There was a problem hiding this comment.
lgtm! can we rebase on latest rolling before running CI?
|
This currently depends on ros2/ament_cmake_ros#62 |
|
Per a discussion with @skyegalaxy today: would it be possible to get the component container + isolated variant of this? I can have this as a tested variant in Nav2 then |
|
@SteveMacenski - I see that there are these two PRs #3055, #3080 to try and generalize the component container across executors, but I'm not sure if that'll get in before the feature freeze. Absent that, we could probably just create a dedicated one for now |
|
@SteveMacenski - draft PR here: #3123 |
This commit adds the callback group events executor. It features: - multithreading support - correct handling of sim time - usage of the events subsystem Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <j.machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <j.machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <j.machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <j.machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
…ager This code was copied straight from the executor and seems to be a workaround for the multithreaded executor, that breaks in this use case. The correct solution for us is to do the timer->call() from within the worker thread. This fixes a deadlock due to double acquisition of an internal lock within the timer manager. Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
In case the next timer wakeup time is not changed by an insertion of a timer, don't wake up the timer thread. Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
b7e95f7 to
26654ef
Compare
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
This commit adds the callback group events executor. It features:
Description
This moved the events cbg executor from cm_executors into rlcpp mainline.
Did you use Generative AI?
No