Skip to content

[DRAFT] Backports EventsExecutor from rolling/upstream #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: irobot/humble
Choose a base branch
from

Conversation

apojomovsky
Copy link

This PR merges the EventsExecutor from the official repository.

@apojomovsky apojomovsky force-pushed the apojomovsky/upstream-events-executor branch from 1f80ed2 to 43ca625 Compare April 16, 2024 19:22
@apojomovsky apojomovsky force-pushed the apojomovsky/upstream-events-executor branch 3 times, most recently from e860ad2 to f52e445 Compare May 10, 2024 18:17
mjcarroll and others added 5 commits May 16, 2024 15:04
* Deprecate callback_group call taking context

Signed-off-by: Michael Carroll <[email protected]>

* Add base executor objects that can be used by implementors

Signed-off-by: Michael Carroll <[email protected]>

* Template common operations

Signed-off-by: Michael Carroll <[email protected]>

* Address reviewer feedback:

* Add callback to EntitiesCollector constructor
* Make function to check automatically added callback groups take a list

Signed-off-by: Michael Carroll <[email protected]>

* Lint

Signed-off-by: Michael Carroll <[email protected]>

* Address reviewer feedback and fix templates

Signed-off-by: Michael Carroll <[email protected]>

* Lint and docs

Signed-off-by: Michael Carroll <[email protected]>

* Make executor own the notify waitable

Signed-off-by: Michael Carroll <[email protected]>

* Add pending queue to collector, remove from waitable

Also change node's get_guard_condition to return shared_ptr

Signed-off-by: Michael Carroll <[email protected]>

* Change interrupt guard condition to shared_ptr

Check if guard condition is valid before adding it to the waitable

Signed-off-by: Michael Carroll <[email protected]>

* Lint and docs

Signed-off-by: Michael Carroll <[email protected]>

* Utilize rclcpp::WaitSet as part of the executors

Signed-off-by: Michael Carroll <[email protected]>

* Don't exchange atomic twice

Signed-off-by: Michael Carroll <[email protected]>

* Fix add_node and add more tests

Signed-off-by: Michael Carroll <[email protected]>

* Make get_notify_guard_condition follow API tick-tock

Signed-off-by: Michael Carroll <[email protected]>

* Improve callback group tick-tocking

Signed-off-by: Michael Carroll <[email protected]>

* Don't lock twice

Signed-off-by: Michael Carroll <[email protected]>

* Address reviewer feedback

Signed-off-by: Michael Carroll <[email protected]>

* Add thread safety annotations and make locks consistent

Signed-off-by: Michael Carroll <[email protected]>

* @wip

Signed-off-by: Michael Carroll <[email protected]>

* Reset callback groups for multithreaded executor

Signed-off-by: Michael Carroll <[email protected]>

* Avoid many small function calls when building executables

Signed-off-by: Michael Carroll <[email protected]>

* Re-trigger guard condition if buffer has data

Signed-off-by: Michael Carroll <[email protected]>

* Address reviewer feedback

Signed-off-by: Michael Carroll <[email protected]>

* Trace points

Signed-off-by: Michael Carroll <[email protected]>

* Remove tracepoints

Signed-off-by: Michael Carroll <[email protected]>

* Reducing diff

Signed-off-by: Michael Carroll <[email protected]>

* Reduce diff

Signed-off-by: Michael Carroll <[email protected]>

* Uncrustify

Signed-off-by: Michael Carroll <[email protected]>

* Restore tests

Signed-off-by: Michael Carroll <[email protected]>

* Back to weak_ptr and reduce test time

Signed-off-by: Michael Carroll <[email protected]>

* reduce diff and lint

Signed-off-by: Michael Carroll <[email protected]>

* Restore static single threaded tests that weren't working before

Signed-off-by: Michael Carroll <[email protected]>

* Restore more tests

Signed-off-by: Michael Carroll <[email protected]>

* Fix multithreaded test

Signed-off-by: Michael Carroll <[email protected]>

* Fix assert

Signed-off-by: Michael Carroll <[email protected]>

* Fix constructor test

Signed-off-by: Michael Carroll <[email protected]>

* Change ready_executables signature back

Signed-off-by: Michael Carroll <[email protected]>

* Don't enforce removing callback groups before nodes

Signed-off-by: Michael Carroll <[email protected]>

* Remove the "add_valid_node" API

Signed-off-by: Michael Carroll <[email protected]>

* Only notify if the trigger condition is valid

Signed-off-by: Michael Carroll <[email protected]>

* Only trigger if valid and needed

Signed-off-by: Michael Carroll <[email protected]>

* Fix spin_some/spin_all implementation

Signed-off-by: Michael Carroll <[email protected]>

* Restore single threaded executor

Signed-off-by: Michael Carroll <[email protected]>

* Picking ABI-incompatible executor changes

Signed-off-by: Michael Carroll <[email protected]>

* Add PIMPL

Signed-off-by: Michael Carroll <[email protected]>

* Additional waitset prune

Signed-off-by: Michael Carroll <[email protected]>

* Fix bad merge

Signed-off-by: Michael Carroll <[email protected]>

* Expand test timeout

Signed-off-by: Michael Carroll <[email protected]>

* Introduce method to clear expired entities from a collection

Signed-off-by: Michael Carroll <[email protected]>

* Make sure to call remove_expired_entities().

Signed-off-by: Chris Lalancette <[email protected]>

* Prune queued work when callback group is removed

Signed-off-by: Michael Carroll <[email protected]>

* Prune subscriptions from dynamic storage

Signed-off-by: Michael Carroll <[email protected]>

* Styles fixes.

Signed-off-by: Chris Lalancette <[email protected]>

* Re-trigger guard conditions

Signed-off-by: Michael Carroll <[email protected]>

* Condense to just use watiable.take_data

Signed-off-by: Michael Carroll <[email protected]>

* Lint

Signed-off-by: Michael Carroll <[email protected]>

* Address reviewer comments (nits)

Signed-off-by: Michael Carroll <[email protected]>

* Lock mutex when copying

Signed-off-by: Michael Carroll <[email protected]>

* Refactors to static single threaded based on reviewers

Signed-off-by: Michael Carroll <[email protected]>

* More small refactoring

Signed-off-by: Michael Carroll <[email protected]>

* Lint

Signed-off-by: Michael Carroll <[email protected]>

* Lint

Signed-off-by: Michael Carroll <[email protected]>

* Add ready executable accessors to WaitResult

Signed-off-by: Michael Carroll <[email protected]>

* Make use of accessors from wait_set

Signed-off-by: Michael Carroll <[email protected]>

* Fix tests

Signed-off-by: Michael Carroll <[email protected]>

* Fix more tests

Signed-off-by: Michael Carroll <[email protected]>

* Tidy up single threaded executor implementation

Signed-off-by: Michael Carroll <[email protected]>

* Don't null out timer, rely on call

Signed-off-by: Michael Carroll <[email protected]>

* change how timers are checked from wait result in executors

Signed-off-by: William Woodall <[email protected]>

* peak -> peek

Signed-off-by: William Woodall <[email protected]>

* fix bug in next_waitable logic

Signed-off-by: William Woodall <[email protected]>

* fix bug in StaticSTE that broke the add callback groups to executor tests

Signed-off-by: William Woodall <[email protected]>

* style

Signed-off-by: William Woodall <[email protected]>

---------

Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: William Woodall <[email protected]>
Co-authored-by: Chris Lalancette <[email protected]>
Co-authored-by: William Woodall <[email protected]>
The commit also includes a few test fixes and temporary comments
allowing the unit-tests, and the full package, to build.
Get the upstream executor_notify_waitable.cpp/.hpp and the
test_executors_timer_cancel_behavior unit-test
Signed-off-by: Alexis Tsogias <[email protected]>
Signed-off-by: Janosch Machowinski <[email protected]>
Co-authored-by: Alexis Tsogias <[email protected]>
Co-authored-by: Janosch Machowinski <[email protected]>
@apojomovsky apojomovsky force-pushed the apojomovsky/upstream-events-executor branch from f52e445 to 443b777 Compare May 16, 2024 19:49
apojomovsky and others added 5 commits May 17, 2024 16:26
* trigger guard condition waitset regardless of whether a trigger callback is present

Signed-off-by: Alberto Soragna <[email protected]>

* restore mutex in guard_condition.cpp

Signed-off-by: Alberto Soragna <[email protected]>

* remove whitespace

Signed-off-by: Alberto Soragna <[email protected]>

* add unit-test

Signed-off-by: Alberto Soragna <[email protected]>

* add documentation for trigger and set_on_trigger_callback

Signed-off-by: Alberto Soragna <[email protected]>
@apojomovsky apojomovsky force-pushed the apojomovsky/upstream-events-executor branch from 2b32d25 to 03163bf Compare May 29, 2024 18:01
This reverts commit a09f6f8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants