Skip to content
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

irobot/master-events-executor features #87

Open
wants to merge 23 commits into
base: irobot/master-events-executor
Choose a base branch
from

Conversation

mauropasse
Copy link
Collaborator

@mauropasse mauropasse commented Mar 14, 2022

This PR is a placeholder for current works on EventsExecutor

  • It has the current ROS2 rclcpp master merged
  • Needs Add rcl guard condition on_trigger_callback ros2/rcl#966, which adds on_trigger_callback to guard conditions.
  • rclcpp::Timers: Add set_on_reset_callback APIs (uses above PR)
  • TimersManager: Use new on_reset_callback APIs to wake up when a timer is reset.
  • Support action expire timers with callbacks approach
  • This is still WIP and tests needed

alsora and others added 23 commits February 9, 2022 11:45
* replace spin_until_future_complete with spin in component_manager_isolated.hpp

spin_until_future_complete() is more inefficient as it needs to check the state of the future and the timeout after every work iteration

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

* fix uncrustify error

Signed-off-by: Alberto Soragna <[email protected]>
* use universal reference to support rvalue.

Signed-off-by: Tomoya Fujita <[email protected]>
* initial attempt, problems with ament_gen_version_h

Signed-off-by: Shane Loretz <[email protected]>

* remove blank line

Signed-off-by: Shane Loretz <[email protected]>
* Add RMW listener APIs

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

* split long log into two lines

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

* Remove use_previous_event

Signed-off-by: Mauro Passerino <[email protected]>

* Do not set gc listener callback

Signed-off-by: Mauro Passerino <[email protected]>

* significant refactor to make callbacks type safe

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

* Add on_ready callback to waitables, add clear_* functions, add unit-tests

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

* add mutex to set and clear listener APIs

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

* allow to set ipc sub callback from regular subscription

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

* fix minor failures

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

* fix typos and errors in comments

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

* fix comments

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

* expose qos listener APIs from pub and sub; add unit-tests

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

* add qos event unit-test for invalid callbacks

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

* Use QoS depth to limit callbacks count

Signed-off-by: Mauro Passerino <[email protected]>

* fix ipc-subscription

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

* Rename CallbackMessageT -> ROSMessageType

Signed-off-by: Mauro Passerino <[email protected]>

* Set callbacks to Actions

Signed-off-by: Mauro Passerino <[email protected]>

* changes from upstream

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

* Unset callback on entities destruction

Signed-off-by: Mauro Passerino <[email protected]>

* fix rebase errors

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

* fix unit-tests

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

* Add GuardCondition on trigger callback

Signed-off-by: Mauro Passerino <[email protected]>

* Add tests for new GuardCondition APIs

Signed-off-by: Mauro Passerino <[email protected]>

* Fix windows CI

Signed-off-by: Mauro Passerino <[email protected]>

* Action unset callbacks only if were set

Signed-off-by: Mauro Passerino <[email protected]>

* add missing include rcl event callback include directive

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

* typos

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

* remove listener reference

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

* remove references to listener and move a method closer to impl

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

* cpplint

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

* Fix qos history check in subscription_intra_process.hpp

Co-authored-by: Mauro Passerino <[email protected]>
Co-authored-by: William Woodall <[email protected]>
Co-authored-by: Alberto Soragna <[email protected]>
* spin_all with a zero timeout.

Signed-off-by: Tomoya Fujita <[email protected]>
Signed-off-by: Mauro Passerino <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
* Use a single call to collect all CallbackGroup pointers.

Believe it or not, the taking and releasing of mutex_ within
the CallbackGroup class shows up in profiles.  However, when
collecting entities we really don't need to take it and drop
it between each of subscriptions, services, clients, timers,
and waitables.  Just take it once at the beginning, collect
everything, and then return, which removes a lot of unnecessary
work with that mutex.

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

* Pass shared_ptr as constref in the MemoryStrategy class.

That way, in the case that the callee doesn't need to take
a reference, we avoid creating and destroying a shared_ptr
class.  This reduces the overhead in using these functions,
and seems to work fine in the default case.  If a user wants
to subclass the MemoryStrategy class, then they can explicitly
create a shared_ptr copy by using the copy constructor.

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

* Use constref shared_ptr when iterating.

Believe it or not, the creation and destruction of the
shared_ptr class itself shows up in profiles in these loops.
Since we don't need to hold onto a reference while iterating
(the class is already doing that), just use constref wherever
we can which drastically reduces the overhead.

Signed-off-by: Chris Lalancette <[email protected]>
* time_until_trigger returns max time if timer is cancelled

Signed-off-by: Mauro Passerino <[email protected]>
Signed-off-by: Mauro Passerino <[email protected]>
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.

6 participants