-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add EventsExecutor #286
Add EventsExecutor #286
Conversation
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros2-middleware-change-proposal/15863/20 |
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros2-middleware-change-proposal/15863/29 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
I have left some minor comments about the API, but I think it doesn't make a big difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good.
I still have a minimal preference for not having an rmw_listener_event_t
argument in the listener callbacks and making that part of user_data
(which will require registering not exactly the same function in all listeners of the event executor, but it can be an small wrapper of a common function).
Without the rmw_listener_event_t
argument, the extra void * <type>_handle
is also not required in the functions that register a listener.
Anyways, I think that adding this makes sense.
I would recommend ignoring my suggestions until @wjwwood also reviews (to avoid unnecessary iterations).
edit: I also think it would be fine to have two void *
user data arguments (e.g.: void * arg1, void * arg2
and maybe, arg3
), and in that case an extra wrapper is not needed.
I see there is some discussion over on ros2/design#305 about executors being supported out of tree. Will this PR get merged even if the other is still being discussed? |
I've been testing these changes with some rebasing. I think things are looking good. I still have one item to follow up on design wise, but in the mean time we need to clean up the commit history. Ideally, we could organize the commits (maybe squash them into one or at least fewer commits), but at the very least we need to have all the commits passing the DCO checker. This goes for the other pull requests too. I would offer to do this for you, but I really need you guys to do the DCO signing. I cannot test it until master is merged in or rebased against master (my preference). |
That's the plan. Merge the rmw/rcl changes related to "listener" style API, and then iterate on the c++ executor designs asynchronously. |
c413e7c
to
9c15c64
Compare
@irobot-ros or @mauropasse, is it ok if I push directly (maybe force push to rebase) to this pull request branch? Or should I make my own? |
@wjwwood yes sure, go ahead and push to this branch if you prefer. FYI we just pushed a commit (here and in other PRs) that removes guard condition listeners as discussed in last Middleware WG. |
f661341
to
d56fd64
Compare
@irobot-ros @mauropasse there are some test failures (I can fix the uncrustify one for https://ci.ros2.org/job/ci_linux/14198/testReport/ I know it must be getting close to you guy's weekend, so if not I'll try to investigate tomorrow some if I have time. |
I fixed the fastrtps uncrustify errors. |
I'll take a look to the other failing tests. |
add constness Use or discard previous events: Guard conditions Move parentheses Rename Event_callback to ExecutorEventCallback update name Add events support void return on set_events_executor_callback Revert "void return on set_events_executor_callback" Rename ExecutorEventCallback -> EventsExecutorCallback Rename set_events_executor_callback->set_listener_callback Use data types when setting callbacks Move rcutils/executor_event_types.h to rmw/ Add executor_event_types.h rename event types Rename executor_context->callback_context Add APIs documentation Modify doc Rename callback_context->user_data Reorder APIs arguments Add more info on set_listener_callback comments rename rmw_listener_cb_t->rmw_listener_callback_t Add missing comments use void * to pass executor ptr Rework executor callback data Use RMW renamed file Define publisher/subscription event types Signed-off-by: Alberto Soragna <asoragna@irobot.com>
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Signed-off-by: William Woodall <william@osrfoundation.org>
8bff3d0
to
9492336
Compare
I'm rerunning CI for this without the rclcpp pull request (ros2/rclcpp#1579): If it looks good, then we can at least take those API's in, and maybe we can do ABI stable additions to |
I went through the failing tests
They are all fixed with my temporary workaround on CycloneDDS eclipse-cyclonedds/cyclonedds#699 , the issue is what I explained on #286 (comment) |
…-executor Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com>
This PR introduces the changes required to implement the
EventsExecutor
design in rmw.See design and Discourse post.
The new executor uses an events queue and a timers manager as opposed to waitsets, to efficiently execute entities with work to do.
This new executor greatly reduces CPU usage of a ROS 2 application.
See the blog post for more details on the tests that we run.
The bulk of the changes for this implementation are in the rclcpp layer, with some minor changes in other repositories (rcl, rmw, rmw_implementation) for forwarding entities, the declaration of some data types in rcutils, and finally some additional changes in the vendor specific rmw implementations..
We currently implemented this only on top of the default ROS middleware fastrtps, while we provided stubs for other middlewares.
See the main PR to rclcpp ros2/rclcpp#1416.
The current implementation does not support ROS 2 actions, which will be added in a follow up PR.
Developed by iRobot
Mauro Passerino
Lenny Story
Alberto Soragna
Connects to: