-
Notifications
You must be signed in to change notification settings - Fork 267
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
Expose node options to controller manager #942
Conversation
I'd also like this backported to humble when it's ready! |
Signed-off-by: methylDragon <methylDragon@gmail.com>
05d961c
to
2ce1204
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.
I agree! Thanks for this extension!
and.... WOW! this is a great explanation! Thanks for this. Would you mind adding at least parts of the explanation into documentation describing your use case of adding controller manager into other nodes. In doc
folder are documentation files generated for control.ros.org
@bmagyar this is a API braking change... How many users would actually feel it? |
I've updated the docs! |
Signed-off-by: methylDragon <methylDragon@gmail.com>
e66a505
to
009d555
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.
Thanks!
I don't think many would notice the API change since it's handled w default values for parameters. The ABI change may pose a small issue but also it's mostly within the same package so I wouldn't worry too much. I think this PR is good for a backport |
@Mergifyio backport humble |
✅ Backports have been created
|
Signed-off-by: methylDragon <methylDragon@gmail.com> (cherry picked from commit 3a09fb3)
Description and Scope
This PR exposes an
options
argument to theControllerManager
constructor to allow for users to configure NodeOptions to be given to the class.It also exposes the
get_cm_node_options()
function for downstream use.The default behavior doesn't change, this just adds a way for users to configure the manager. It shouldn't affect anyone downstream, but enables more configuration, and opens the path to fixing node name duplications down the line.
Context
The
ControllerManager
as its being used in this package doesn't need this functionality, but since it is aNode
, downstream users (or more saliently, myself 😬) might want to instantiate it independently in a separate process.This might lead to a case where there is more than one Node in the process, which can cause global node name remaps to forcibly change the
ControllerManager's
node name, leading to duplicate node names.Design
The fix for this situation is to either:
Or:
NodeOptions
passed to a node (causing it to ignore the global rule)The former case requires users to be made aware of the constraint when writing launchfiles/starting the node up in CLI.
Whereas the latter case avoids that downside, but requires a NodeOptions to get passed to the node.
This change I'm proposing not only benefits my use case (fixing the node name remap issue), but also allows users to further configure the
ControllerManager's
node options if needed.The intended use of this change would be for users to either ignore the NodeOptions arg, (i.e. nothing changes)
auto cm = std::make_shared<controller_manager::ControllerManager>(executor, manager_node_name);
Or create a NodeOptions object using
get_cm_node_options()
and then configure it.There aren't any alternative solutions for this other than telling users downstream to change the way they use CLI/launch, and that's kinda fragile. So it would be good to get this in.