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

Add more explanation about PushRosNamespace action (backport #4679) #4765

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions source/How-To-Guides/Launch-file-different-formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Each launch file performs the following actions:
from launch.substitutions import LaunchConfiguration
from launch.substitutions import TextSubstitution
from launch_ros.actions import Node
from launch_ros.actions import PushRosNamespace
from launch_ros.actions import PushROSNamespace
from launch_xml.launch_description_sources import XMLLaunchDescriptionSource
from launch_yaml.launch_description_sources import YAMLLaunchDescriptionSource

Expand Down Expand Up @@ -82,8 +82,8 @@ Each launch file performs the following actions:
# include a Python launch file in the chatter_py_ns namespace
launch_py_include_with_namespace = GroupAction(
actions=[
# push_ros_namespace to set namespace of included nodes
PushRosNamespace('chatter_py_ns'),
# push_ros_namespace first to set namespace of included nodes for following actions
PushROSNamespace('chatter_py_ns'),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(
Expand All @@ -96,8 +96,8 @@ Each launch file performs the following actions:
# include a xml launch file in the chatter_xml_ns namespace
launch_xml_include_with_namespace = GroupAction(
actions=[
# push_ros_namespace to set namespace of included nodes
PushRosNamespace('chatter_xml_ns'),
# push_ros_namespace first to set namespace of included nodes for following actions
PushROSNamespace('chatter_xml_ns'),
IncludeLaunchDescription(
XMLLaunchDescriptionSource(
os.path.join(
Expand All @@ -110,8 +110,8 @@ Each launch file performs the following actions:
# include a yaml launch file in the chatter_yaml_ns namespace
launch_yaml_include_with_namespace = GroupAction(
actions=[
# push_ros_namespace to set namespace of included nodes
PushRosNamespace('chatter_yaml_ns'),
# push_ros_namespace first to set namespace of included nodes for following actions
PushROSNamespace('chatter_yaml_ns'),
IncludeLaunchDescription(
YAMLLaunchDescriptionSource(
os.path.join(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ However, if the launch file contains a large number of nodes, defining namespace
To solve that issue, the ``PushROSNamespace`` action can be used to define the global namespace for each launch file description.
Every nested node will inherit that namespace automatically.

.. attention:: PushROSNamespace has to be the first Action in the list for the following actions to apply the namespace

To do that, firstly, we need to remove the ``namespace='turtlesim2'`` line from the ``turtlesim_world_2_launch.py`` file.
Afterwards, we need to update the ``launch_turtlesim_launch.py`` to include the following lines:

Expand Down