Skip to content

Commit b66ef49

Browse files
OmarRebaiorebaiSteveMacenskinishalangovenderclaude[bot]
authored
fix: Add PushRosNamespace action to navigation launch file and update… (#5300)
* fix: Add PushRosNamespace action to navigation launch file and update comments for parameter namespacing Signed-off-by: orebai <omar.rebai@habemus.com> * fix: Reorder import statements in navigation launch file for consistency Signed-off-by: orebai <omar.rebai@habemus.com> * fix: Correct formatting of comments in navigation launch file for clarity Signed-off-by: orebai <omar.rebai@habemus.com> * fix: Add PushRosNamespace action to multiple launch files for parameter namespacing Signed-off-by: orebai <omar.rebai@habemus.com> * fix: Add PushRosNamespace action to slam_launch.py for parameter namespacing Signed-off-by: orebai <omar.rebai@habemus.com> * Adding logging for matched events and dropped messages into pub/sub of new nav2_ros_common package. Also adding QoS overrides default ON (#5302) * Adding logging for matched events and dropped messages Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * toggle on Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * apply for smac 2D Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * Update interface_factories.hpp Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> --------- Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: orebai <omar.rebai@habemus.com> * Add LaunchConfigAsBool (Fixes #5233) (#5301) * Add LaunchConfigAsBool (Fixes #5233) Signed-off-by: nishalangovender <nishalan.govender@gmail.com> * Fix Linting Signed-off-by: nishalangovender <nishalan.govender@gmail.com> * Fix ament_mypy and pre-commit Signed-off-by: nishalangovender <nishalan.govender@gmail.com> * Added Type Annotations Signed-off-by: Nishalan Govender <nishalan.govender@gmail.com> * mypy ignore Signed-off-by: Nishalan Govender <nishalan.govender@gmail.com> * launch.Substitution Signed-off-by: Nishalan Govender <nishalan.govender@gmail.com> * Update All Bools in nav2_bringup Signed-off-by: Nishalan Govender <nishalan.govender@gmail.com> --------- Signed-off-by: nishalangovender <nishalan.govender@gmail.com> Signed-off-by: Nishalan Govender <nishalan.govender@gmail.com> Signed-off-by: orebai <omar.rebai@habemus.com> * Create claude.yml Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: orebai <omar.rebai@habemus.com> * Update claude.yml Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: orebai <omar.rebai@habemus.com> * Update claude.yml Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: orebai <omar.rebai@habemus.com> * Update claude.yml for authorized users Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: orebai <omar.rebai@habemus.com> * Update claude.yml Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: orebai <omar.rebai@habemus.com> * Update claude.yml Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: orebai <omar.rebai@habemus.com> * Adding clear costmap around pose service option (#5309) * Adding clear costmap around pose impl Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * Update nav2_msgs/srv/ClearCostmapAroundPose.srv Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * Adding APIs for simple commander Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * linting Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * adding import Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> --------- Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: orebai <omar.rebai@habemus.com> * Add support for enable_lifecycle_services parameter in LifecycleNode (#5307) Expose the enable_communication_interface parameter from rclcpp_lifecycle::LifecycleNode through nav2's LifecycleNode wrapper. This allows users to disable lifecycle communication interfaces when manually managing node lifecycle transitions. The parameter can be set via NodeOptions parameter overrides: ```cpp rclcpp::NodeOptions options; options.parameter_overrides({{"enable_lifecycle_services", false}}); ``` Fixes #5305 Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Signed-off-by: orebai <omar.rebai@habemus.com> * fix: Rename PushRosNamespace to PushROSNamespace for consistency across launch files Signed-off-by: orebai <omar.rebai@habemus.com> --------- Signed-off-by: orebai <omar.rebai@habemus.com> Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: nishalangovender <nishalan.govender@gmail.com> Signed-off-by: Nishalan Govender <nishalan.govender@gmail.com> Co-authored-by: orebai <omar.rebai@habemus.com> Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> Co-authored-by: Nishalan Govender <137301877+nishalangovender@users.noreply.github.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent daee7aa commit b66ef49

File tree

6 files changed

+26
-7
lines changed

6 files changed

+26
-7
lines changed

nav2_bringup/launch/bringup_launch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from launch.conditions import IfCondition
2222
from launch.launch_description_sources import PythonLaunchDescriptionSource
2323
from launch.substitutions import LaunchConfiguration, PythonExpression
24-
from launch_ros.actions import Node, PushROSNamespace
24+
from launch_ros.actions import Node
2525
from launch_ros.descriptions import ParameterFile
2626
from nav2_common.launch import LaunchConfigAsBool, RewrittenYaml
2727

@@ -150,10 +150,10 @@ def generate_launch_description() -> LaunchDescription:
150150
# Specify the actions
151151
bringup_cmd_group = GroupAction(
152152
[
153-
PushROSNamespace(namespace),
154153
Node(
155154
condition=IfCondition(use_composition),
156155
name='nav2_container',
156+
namespace=namespace,
157157
package='rclcpp_components',
158158
executable='component_container_isolated',
159159
parameters=[configured_params, {'autostart': autostart}],

nav2_bringup/launch/keepout_zone_launch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
2020
from launch.conditions import IfCondition
2121
from launch.substitutions import LaunchConfiguration, PythonExpression
22-
from launch_ros.actions import LoadComposableNodes, Node, SetParameter
22+
from launch_ros.actions import LoadComposableNodes, Node, PushROSNamespace, SetParameter
2323
from launch_ros.descriptions import ComposableNode, ParameterFile
2424
from nav2_common.launch import LaunchConfigAsBool, RewrittenYaml
2525

@@ -116,6 +116,7 @@ def generate_launch_description() -> LaunchDescription:
116116
load_nodes = GroupAction(
117117
condition=IfCondition(PythonExpression(['not ', use_composition])),
118118
actions=[
119+
PushROSNamespace(namespace),
119120
SetParameter('use_sim_time', use_sim_time),
120121
Node(
121122
condition=IfCondition(use_keepout_zones),
@@ -159,6 +160,7 @@ def generate_launch_description() -> LaunchDescription:
159160
load_composable_nodes = GroupAction(
160161
condition=IfCondition(use_composition),
161162
actions=[
163+
PushROSNamespace(namespace),
162164
SetParameter('use_sim_time', use_sim_time),
163165
LoadComposableNodes(
164166
target_container=container_name_full,

nav2_bringup/launch/localization_launch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from launch.conditions import IfCondition
2121
from launch.substitutions import (EqualsSubstitution, LaunchConfiguration, NotEqualsSubstitution,
2222
PythonExpression)
23-
from launch_ros.actions import LoadComposableNodes, Node, SetParameter
23+
from launch_ros.actions import LoadComposableNodes, Node, PushROSNamespace, SetParameter
2424
from launch_ros.descriptions import ComposableNode, ParameterFile
2525
from nav2_common.launch import LaunchConfigAsBool, RewrittenYaml
2626

@@ -110,6 +110,7 @@ def generate_launch_description() -> LaunchDescription:
110110
load_nodes = GroupAction(
111111
condition=IfCondition(PythonExpression(['not ', use_composition])),
112112
actions=[
113+
PushROSNamespace(namespace),
113114
SetParameter('use_sim_time', use_sim_time),
114115
Node(
115116
condition=IfCondition(
@@ -168,6 +169,7 @@ def generate_launch_description() -> LaunchDescription:
168169
load_composable_nodes = GroupAction(
169170
condition=IfCondition(use_composition),
170171
actions=[
172+
PushROSNamespace(namespace),
171173
SetParameter('use_sim_time', use_sim_time),
172174
LoadComposableNodes(
173175
target_container=container_name_full,

nav2_bringup/launch/navigation_launch.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
2020
from launch.conditions import IfCondition
2121
from launch.substitutions import LaunchConfiguration, PythonExpression
22-
from launch_ros.actions import LoadComposableNodes, Node, SetParameter
22+
from launch_ros.actions import LoadComposableNodes, Node, PushROSNamespace, SetParameter
2323
from launch_ros.descriptions import ComposableNode, ParameterFile
2424
from nav2_common.launch import LaunchConfigAsBool, RewrittenYaml
2525

@@ -65,6 +65,14 @@ def generate_launch_description() -> LaunchDescription:
6565
'SPEED_ZONE_ENABLED': use_speed_zones,
6666
}
6767

68+
# RewrittenYaml: Adds namespace to the parameters file as a root key
69+
# Note: Make sure that all frames are correctly namespaced in the parameters file
70+
# Do not add namespace to topics in the parameters file, as they will be remapped
71+
# by the root key only if they are not prefixed with a forward slash.
72+
# e.g. 'map' will be remapped to '/<namespace>/map', but '/map' will not be remapped.
73+
# IMPORTANT: to make your yaml file dynamic you can refer to humble branch under
74+
# nav2_bringup/launch/bringup_launch.py to see how the parameters file is configured
75+
# using ReplaceString <robot_namespace>
6876
configured_params = ParameterFile(
6977
RewrittenYaml(
7078
source_file=params_file,
@@ -143,6 +151,7 @@ def generate_launch_description() -> LaunchDescription:
143151
condition=IfCondition(PythonExpression(['not ', use_composition])),
144152
actions=[
145153
SetParameter('use_sim_time', use_sim_time),
154+
PushROSNamespace(namespace=namespace),
146155
Node(
147156
package='nav2_controller',
148157
executable='controller_server',
@@ -267,6 +276,7 @@ def generate_launch_description() -> LaunchDescription:
267276
condition=IfCondition(use_composition),
268277
actions=[
269278
SetParameter('use_sim_time', use_sim_time),
279+
PushROSNamespace(namespace=namespace),
270280
LoadComposableNodes(
271281
target_container=container_name_full,
272282
composable_node_descriptions=[

nav2_bringup/launch/slam_launch.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from launch.conditions import IfCondition, UnlessCondition
2121
from launch.launch_description_sources import PythonLaunchDescriptionSource
2222
from launch.substitutions import LaunchConfiguration
23-
from launch_ros.actions import Node, SetParameter, SetRemap
23+
from launch_ros.actions import Node, PushROSNamespace, SetParameter, SetRemap
2424
from launch_ros.descriptions import ParameterFile
2525
from nav2_common.launch import HasNodeParams, LaunchConfigAsBool, RewrittenYaml
2626

@@ -89,6 +89,7 @@ def generate_launch_description() -> LaunchDescription:
8989
# Nodes launching commands
9090
start_map_server = GroupAction(
9191
actions=[
92+
PushROSNamespace(namespace),
9293
SetParameter('use_sim_time', use_sim_time),
9394
Node(
9495
package='nav2_map_server',
@@ -120,6 +121,8 @@ def generate_launch_description() -> LaunchDescription:
120121
start_slam_toolbox_cmd = GroupAction(
121122

122123
actions=[
124+
PushROSNamespace(namespace),
125+
123126
# Remapping required to have a slam session subscribe & publish in optional namespaces
124127
SetRemap(src='/scan', dst='scan'),
125128
SetRemap(src='/tf', dst='tf'),

nav2_bringup/launch/speed_zone_launch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
2020
from launch.conditions import IfCondition
2121
from launch.substitutions import LaunchConfiguration, PythonExpression
22-
from launch_ros.actions import LoadComposableNodes, Node, SetParameter
22+
from launch_ros.actions import LoadComposableNodes, Node, PushROSNamespace, SetParameter
2323
from launch_ros.descriptions import ComposableNode, ParameterFile
2424
from nav2_common.launch import LaunchConfigAsBool, RewrittenYaml
2525

@@ -116,6 +116,7 @@ def generate_launch_description() -> LaunchDescription:
116116
load_nodes = GroupAction(
117117
condition=IfCondition(PythonExpression(['not ', use_composition])),
118118
actions=[
119+
PushROSNamespace(namespace),
119120
SetParameter('use_sim_time', use_sim_time),
120121
Node(
121122
condition=IfCondition(use_speed_zones),
@@ -159,6 +160,7 @@ def generate_launch_description() -> LaunchDescription:
159160
load_composable_nodes = GroupAction(
160161
condition=IfCondition(use_composition),
161162
actions=[
163+
PushROSNamespace(namespace),
162164
SetParameter('use_sim_time', use_sim_time),
163165
LoadComposableNodes(
164166
target_container=container_name_full,

0 commit comments

Comments
 (0)