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

Append ros namespace to target container if available. #429

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions launch_ros/launch_ros/actions/load_composable_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ def execute(
'target container is neither a ComposableNodeContainer nor a SubstitutionType')
return

# Check if a global ros_namespace has been set with push ros namespace.
base_ns = context.launch_configurations.get('ros_namespace', None)
if base_ns is not None:
self.__final_target_container_name = make_namespace_absolute(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be applied to the service client to load the composable nodes below.
without having this fix, service path is not appended with namespace, that fails to call the load request for target container.

prefix_namespace(base_ns, self.__final_target_container_name)
)

# Create a client to load nodes in the target container.
self.__rclpy_load_node_client = get_ros_node(context).create_client(
composition_interfaces.srv.LoadNode, '{}/_container/load_node'.format(
Expand Down