-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix (howto-launch): namespace on IncludeLaunchDescription #2620
Conversation
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 looks fine to me, but I want a second opinion. @audrow can you confirm?
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 the PR @krsche. I think this should be retargeted to rolling
and then backported to humble
, since the error is also in rolling
. Would you mind rebasing this commit on rolling
?
@@ -75,7 +75,7 @@ Each launch file performs the following actions: | |||
launch_include_with_namespace = GroupAction( | |||
actions=[ | |||
# push_ros_namespace to set namespace of included nodes | |||
PushRosNamespace(LaunchConfiguration('chatter_ns')), | |||
PushRosNamespace(namespace='chatter_ns'), |
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.
Reviewing LaunchConfiguration() and its interaction with PushRosNamespace
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.
Possible Solution:
setting the default_value of the DeclareLaunchArgument to the LaunchConfiguration value according to following modification:
namespace = LaunchConfiguration('namespace')
... Other code goes here....
DeclareLaunchArgument(
'namespace', default_value=namespace,
description='Top-level namespace'),
2. Adding PushRosNamespace(namespace=namespace) to the LaunchDescription in example.launch.py
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'm not sure what you mean. For me passing a string directly to PushRosNamespace
works, can you elaborate what you're suggesting?
@audrow changed the target to |
We have a bot for it, so not to worry. |
(cherry picked from commit 54e7959)
Thanks for the PR @krsche! |
Following the documentation for including another launch file under a specific namespace I encountered an error.
Code:
Error when launching:
Resolution:
Looking at other code I noticed that people are using it differently instaed and the implementation of
PushRosNamespace
suggests to me that this is they way to go.