-
Couldn't load subscription status.
- Fork 475
Add option for the events executor to the isolated component container #2541
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
base: rolling
Are you sure you want to change the base?
Add option for the events executor to the isolated component container #2541
Conversation
| std::vector<std::string> args = rclcpp::remove_ros_arguments(argc, argv); | ||
| for (auto & arg : args) { | ||
| if (arg == std::string("--use_multi_threaded_executor")) { | ||
| if (arg == std::string("--use_multi_threaded_executor") || |
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.
Since using underscores in command flags is very uncommon. I added the new option with dashes and allowed for the same here.
Perhaps in the future we can deprecate the original flag based on discussion here.
5deb093 to
2c75845
Compare
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.
a couple of questions,
EventsExecutoris still experimental, do we want to bring experimental executor intoComponentManager? I am not sure about this, any thoughts?- Before adding
EventsExecutortoComponentManagerIsolated, probably we would want to supportComponentManager?
IMO, this feature is really nice to have. but i think EventsExecutor should support simulation time before this support, see #2480
|
Before we move forward with this, I think it'd be good to do @fujitatomoya's comment of adding this to the |
we should have a discussion on what would be the steps necessary to bring it out of experimental, but IMO this shouldn't prevent from using it here (especially because it's not the default).
I agree. |
|
Your last arguments ( |
|
This pull request has been mentioned on ROS Discourse. There might be relevant details there: |
9bcecb7 to
b790207
Compare
|
@Timple the PR looks good. |
b790207 to
b2c64b0
Compare
|
Rebased |
|
Why is this blocked? |
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.
previous comments #2541 (review) and #2541 (comment), probably we can do this kind of refactoring in rolling without backporting. so i think those do not need to be addressed with this PR.
| exec = std::make_shared<executor>(); | ||
| node = std::make_shared<ComponentManagerIsolated>(exec); | ||
| } else { | ||
| std::cerr << "Invalid executor type: " << executor_type << std::endl; |
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.
this is actually behavior change compared to before. before, even if user specify the wrong option, that falls back to SingleThreadedExecutor, but now it fails and user does not really know what can be set. it would be probably nice to show what and how executor types are set? or command line helper function can be introduced?
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.
this is actually behavior change compared to before.
Same as before, if nothing is supplied the single-threaded is used.
Only if previously the user supplied a non-existent option with a non-existent executor this is a behavior change:
ros2 run rclcpp_components component_container --executor-type something-wrong
But that would be a great coincidence I guess. As the --executor-type never existed.
| using executor = rclcpp::executors::MultiThreadedExecutor; | ||
| using ComponentManagerIsolated = rclcpp_components::ComponentManagerIsolated<executor>; | ||
| exec = std::make_shared<executor>(); | ||
| node = std::make_shared<ComponentManagerIsolated>(exec); |
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.
this is also behavior change compared to before. before, it creates ComponentManagerIsolated node with SingleThreadedExecutor always. but now creating ComponentManagerIsolated node with MultiThreadedExecutor, i do not think this is needed since component node is expected to do the simple task like load/unload the components. is this intentional change?
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.
This was the old code:
if (use_multi_threaded_executor) {
using ComponentManagerIsolated =
rclcpp_components::ComponentManagerIsolated<rclcpp::executors::MultiThreadedExecutor>;So I do not recognise this:
before, it creates ComponentManagerIsolated node with SingleThreadedExecutor always
Can you elaborate?
| break; | ||
| } | ||
| } else if (args[i] == "--use_multi_threaded_executor") { // backward compatibility | ||
| executor_type = "multi-threaded"; |
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.
it would be probably nice to add message for user, that this option is deprecated?
|
So it seems that I got bypassed here: #2885 If more hardcoded nodes is the way to go, this can be closed I guess? |
|
@Timple thanks for circling back to this. this PR is the another enhancement to add the option to isolated container, but #2885 only adds the another executable with EventsExecutor. where i can see, these two enhancement is really different. but that is up to you. if you are good to go with #2885 and please go ahead to close this PR. when someone finds and takes over this PR, that is when we can come back to this enhancement? |
Signed-off-by: Tim Clephas <[email protected]>
Signed-off-by: Tim Clephas <[email protected]>
Signed-off-by: Tim Clephas <[email protected]>
Signed-off-by: Tim Clephas <[email protected]>
|
I think I never saw your review and was under the impression this was good to go. |
b2c64b0 to
45898cc
Compare
No description provided.