Skip to content

Commit

Permalink
Remove remaining usage of use_namespace parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <[email protected]>
  • Loading branch information
luca-della-vedova committed Nov 21, 2024
1 parent ac5d861 commit 7ad9241
Show file tree
Hide file tree
Showing 25 changed files with 13 additions and 82 deletions.
22 changes: 2 additions & 20 deletions nav2_bringup/launch/bringup_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from launch_ros.actions import Node
from launch_ros.actions import PushROSNamespace
from launch_ros.descriptions import ParameterFile
from nav2_common.launch import ReplaceString, RewrittenYaml
from nav2_common.launch import RewrittenYaml


def generate_launch_description():
Expand All @@ -39,7 +39,6 @@ def generate_launch_description():

# Create the launch configuration variables
namespace = LaunchConfiguration('namespace')
use_namespace = LaunchConfiguration('use_namespace')
slam = LaunchConfiguration('slam')
map_yaml_file = LaunchConfiguration('map')
use_sim_time = LaunchConfiguration('use_sim_time')
Expand All @@ -58,16 +57,6 @@ def generate_launch_description():
# https://github.com/ros2/launch_ros/issues/56
remappings = [('/tf', 'tf'), ('/tf_static', 'tf_static')]

# Only it applys when `use_namespace` is True.
# '<robot_namespace>' keyword shall be replaced by 'namespace' launch argument
# in config file 'nav2_multirobot_params.yaml' as a default & example.
# User defined config file should contain '<robot_namespace>' keyword for the replacements.
params_file = ReplaceString(
source_file=params_file,
replacements={'<robot_namespace>': ('/', namespace)},
condition=IfCondition(use_namespace),
)

configured_params = ParameterFile(
RewrittenYaml(
source_file=params_file,
Expand All @@ -86,12 +75,6 @@ def generate_launch_description():
'namespace', default_value='', description='Top-level namespace'
)

declare_use_namespace_cmd = DeclareLaunchArgument(
'use_namespace',
default_value='false',
description='Whether to apply a namespace to the navigation stack',
)

declare_slam_cmd = DeclareLaunchArgument(
'slam', default_value='False', description='Whether run a SLAM'
)
Expand Down Expand Up @@ -142,7 +125,7 @@ def generate_launch_description():
# Specify the actions
bringup_cmd_group = GroupAction(
[
PushROSNamespace(condition=IfCondition(use_namespace), namespace=namespace),
PushROSNamespace(namespace),
Node(
condition=IfCondition(use_composition),
name='nav2_container',
Expand Down Expand Up @@ -207,7 +190,6 @@ def generate_launch_description():

# Declare the launch options
ld.add_action(declare_namespace_cmd)
ld.add_action(declare_use_namespace_cmd)
ld.add_action(declare_slam_cmd)
ld.add_action(declare_map_yaml_cmd)
ld.add_action(declare_use_sim_time_cmd)
Expand Down
2 changes: 0 additions & 2 deletions nav2_bringup/launch/cloned_multi_tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def generate_launch_description():
condition=IfCondition(use_rviz),
launch_arguments={
'namespace': TextSubstitution(text=robot_name),
'use_namespace': 'True',
'rviz_config': rviz_config_file,
}.items(),
),
Expand All @@ -154,7 +153,6 @@ def generate_launch_description():
),
launch_arguments={
'namespace': robot_name,
'use_namespace': 'True',
'map': map_yaml_file,
'use_sim_time': 'True',
'params_file': params_file,
Expand Down
10 changes: 0 additions & 10 deletions nav2_bringup/launch/tb3_loopback_simulation.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def generate_launch_description():

# Create the launch configuration variables
namespace = LaunchConfiguration('namespace')
use_namespace = LaunchConfiguration('use_namespace')
map_yaml_file = LaunchConfiguration('map')
params_file = LaunchConfiguration('params_file')
autostart = LaunchConfiguration('autostart')
Expand All @@ -61,12 +60,6 @@ def generate_launch_description():
'namespace', default_value='', description='Top-level namespace'
)

declare_use_namespace_cmd = DeclareLaunchArgument(
'use_namespace',
default_value='false',
description='Whether to apply a namespace to the navigation stack',
)

declare_map_yaml_cmd = DeclareLaunchArgument(
'map',
default_value=os.path.join(bringup_dir, 'maps', 'tb3_sandbox.yaml'),
Expand Down Expand Up @@ -134,7 +127,6 @@ def generate_launch_description():
condition=IfCondition(use_rviz),
launch_arguments={
'namespace': namespace,
'use_namespace': use_namespace,
'use_sim_time': 'True',
'rviz_config': rviz_config_file,
}.items(),
Expand All @@ -144,7 +136,6 @@ def generate_launch_description():
PythonLaunchDescriptionSource(os.path.join(launch_dir, 'bringup_launch.py')),
launch_arguments={
'namespace': namespace,
'use_namespace': use_namespace,
'map': map_yaml_file,
'use_sim_time': 'True',
'params_file': params_file,
Expand Down Expand Up @@ -203,7 +194,6 @@ def generate_launch_description():

# Declare the launch options
ld.add_action(declare_namespace_cmd)
ld.add_action(declare_use_namespace_cmd)
ld.add_action(declare_map_yaml_cmd)
ld.add_action(declare_params_file_cmd)
ld.add_action(declare_autostart_cmd)
Expand Down
10 changes: 0 additions & 10 deletions nav2_bringup/launch/tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def generate_launch_description():
# Create the launch configuration variables
slam = LaunchConfiguration('slam')
namespace = LaunchConfiguration('namespace')
use_namespace = LaunchConfiguration('use_namespace')
map_yaml_file = LaunchConfiguration('map')
use_sim_time = LaunchConfiguration('use_sim_time')
params_file = LaunchConfiguration('params_file')
Expand Down Expand Up @@ -77,12 +76,6 @@ def generate_launch_description():
'namespace', default_value='', description='Top-level namespace'
)

declare_use_namespace_cmd = DeclareLaunchArgument(
'use_namespace',
default_value='false',
description='Whether to apply a namespace to the navigation stack',
)

declare_slam_cmd = DeclareLaunchArgument(
'slam', default_value='False', description='Whether run a SLAM'
)
Expand Down Expand Up @@ -186,7 +179,6 @@ def generate_launch_description():
condition=IfCondition(use_rviz),
launch_arguments={
'namespace': namespace,
'use_namespace': use_namespace,
'use_sim_time': use_sim_time,
'rviz_config': rviz_config_file,
}.items(),
Expand All @@ -196,7 +188,6 @@ def generate_launch_description():
PythonLaunchDescriptionSource(os.path.join(launch_dir, 'bringup_launch.py')),
launch_arguments={
'namespace': namespace,
'use_namespace': use_namespace,
'slam': slam,
'map': map_yaml_file,
'use_sim_time': use_sim_time,
Expand Down Expand Up @@ -255,7 +246,6 @@ def generate_launch_description():

# Declare the launch options
ld.add_action(declare_namespace_cmd)
ld.add_action(declare_use_namespace_cmd)
ld.add_action(declare_slam_cmd)
ld.add_action(declare_map_yaml_cmd)
ld.add_action(declare_use_sim_time_cmd)
Expand Down
10 changes: 0 additions & 10 deletions nav2_bringup/launch/tb4_loopback_simulation.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def generate_launch_description():

# Create the launch configuration variables
namespace = LaunchConfiguration('namespace')
use_namespace = LaunchConfiguration('use_namespace')
map_yaml_file = LaunchConfiguration('map')
params_file = LaunchConfiguration('params_file')
autostart = LaunchConfiguration('autostart')
Expand All @@ -61,12 +60,6 @@ def generate_launch_description():
'namespace', default_value='', description='Top-level namespace'
)

declare_use_namespace_cmd = DeclareLaunchArgument(
'use_namespace',
default_value='false',
description='Whether to apply a namespace to the navigation stack',
)

declare_map_yaml_cmd = DeclareLaunchArgument(
'map',
default_value=os.path.join(bringup_dir, 'maps', 'depot.yaml'), # Try warehouse.yaml!
Expand Down Expand Up @@ -132,7 +125,6 @@ def generate_launch_description():
condition=IfCondition(use_rviz),
launch_arguments={
'namespace': namespace,
'use_namespace': use_namespace,
'use_sim_time': 'True',
'rviz_config': rviz_config_file,
}.items(),
Expand All @@ -142,7 +134,6 @@ def generate_launch_description():
PythonLaunchDescriptionSource(os.path.join(launch_dir, 'bringup_launch.py')),
launch_arguments={
'namespace': namespace,
'use_namespace': use_namespace,
'map': map_yaml_file,
'use_sim_time': 'True',
'params_file': params_file,
Expand Down Expand Up @@ -210,7 +201,6 @@ def generate_launch_description():

# Declare the launch options
ld.add_action(declare_namespace_cmd)
ld.add_action(declare_use_namespace_cmd)
ld.add_action(declare_map_yaml_cmd)
ld.add_action(declare_params_file_cmd)
ld.add_action(declare_autostart_cmd)
Expand Down
10 changes: 0 additions & 10 deletions nav2_bringup/launch/tb4_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def generate_launch_description():
# Create the launch configuration variables
slam = LaunchConfiguration('slam')
namespace = LaunchConfiguration('namespace')
use_namespace = LaunchConfiguration('use_namespace')
map_yaml_file = LaunchConfiguration('map')
use_sim_time = LaunchConfiguration('use_sim_time')
params_file = LaunchConfiguration('params_file')
Expand Down Expand Up @@ -81,12 +80,6 @@ def generate_launch_description():
'namespace', default_value='', description='Top-level namespace'
)

declare_use_namespace_cmd = DeclareLaunchArgument(
'use_namespace',
default_value='false',
description='Whether to apply a namespace to the navigation stack',
)

declare_slam_cmd = DeclareLaunchArgument(
'slam', default_value='False', description='Whether run a SLAM'
)
Expand Down Expand Up @@ -187,7 +180,6 @@ def generate_launch_description():
condition=IfCondition(use_rviz),
launch_arguments={
'namespace': namespace,
'use_namespace': use_namespace,
'use_sim_time': use_sim_time,
'rviz_config': rviz_config_file,
}.items(),
Expand All @@ -197,7 +189,6 @@ def generate_launch_description():
PythonLaunchDescriptionSource(os.path.join(launch_dir, 'bringup_launch.py')),
launch_arguments={
'namespace': namespace,
'use_namespace': use_namespace,
'slam': slam,
'map': map_yaml_file,
'use_sim_time': use_sim_time,
Expand Down Expand Up @@ -261,7 +252,6 @@ def generate_launch_description():

# Declare the launch options
ld.add_action(declare_namespace_cmd)
ld.add_action(declare_use_namespace_cmd)
ld.add_action(declare_slam_cmd)
ld.add_action(declare_map_yaml_cmd)
ld.add_action(declare_use_sim_time_cmd)
Expand Down
2 changes: 0 additions & 2 deletions nav2_bringup/launch/unique_multi_tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def generate_launch_description():
condition=IfCondition(use_rviz),
launch_arguments={
'namespace': TextSubstitution(text=robot['name']),
'use_namespace': 'True',
'rviz_config': rviz_config_file,
}.items(),
),
Expand All @@ -172,7 +171,6 @@ def generate_launch_description():
),
launch_arguments={
'namespace': robot['name'],
'use_namespace': 'True',
'map': map_yaml_file,
'use_sim_time': 'True',
'params_file': params_file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def generate_launch_description():
os.path.join(nav2_bringup_dir, 'launch', 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={'namespace': '', 'use_namespace': 'False'}.items(),
launch_arguments={'namespace': ''}.items(),
)

# start navigation
Expand Down
2 changes: 1 addition & 1 deletion nav2_simple_commander/launch/follow_path_example_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def generate_launch_description():
os.path.join(nav2_bringup_dir, 'launch', 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={'namespace': '', 'use_namespace': 'False'}.items(),
launch_arguments={'namespace': ''}.items(),
)

# start navigation
Expand Down
2 changes: 1 addition & 1 deletion nav2_simple_commander/launch/inspection_demo_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def generate_launch_description():
os.path.join(nav2_bringup_dir, 'launch', 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={'namespace': '', 'use_namespace': 'False'}.items(),
launch_arguments={'namespace': ''}.items(),
)

# start navigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def generate_launch_description():
os.path.join(nav2_bringup_dir, 'launch', 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={'namespace': '', 'use_namespace': 'False'}.items(),
launch_arguments={'namespace': ''}.items(),
)

# start navigation
Expand Down
2 changes: 1 addition & 1 deletion nav2_simple_commander/launch/nav_to_pose_example_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def generate_launch_description():
os.path.join(nav2_bringup_dir, 'launch', 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={'namespace': '', 'use_namespace': 'False'}.items(),
launch_arguments={'namespace': ''}.items(),
)

# start navigation
Expand Down
2 changes: 1 addition & 1 deletion nav2_simple_commander/launch/picking_demo_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def generate_launch_description():
os.path.join(nav2_bringup_dir, 'launch', 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={'namespace': '', 'use_namespace': 'False'}.items(),
launch_arguments={'namespace': ''}.items(),
)

# start navigation
Expand Down
2 changes: 1 addition & 1 deletion nav2_simple_commander/launch/recoveries_example_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def generate_launch_description():
os.path.join(nav2_bringup_dir, 'launch', 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={'namespace': '', 'use_namespace': 'False'}.items(),
launch_arguments={'namespace': ''}.items(),
)

# start navigation
Expand Down
2 changes: 1 addition & 1 deletion nav2_simple_commander/launch/security_demo_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def generate_launch_description():
os.path.join(nav2_bringup_dir, 'launch', 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={'namespace': '', 'use_namespace': 'False'}.items(),
launch_arguments={'namespace': ''}.items(),
)

# start navigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def generate_launch_description():
os.path.join(nav2_bringup_dir, 'launch', 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={'namespace': '', 'use_namespace': 'False'}.items(),
launch_arguments={'namespace': ''}.items(),
)

# start navigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def generate_launch_description():
),
launch_arguments={
'namespace': '',
'use_namespace': 'False',
'map': map_yaml_file,
'use_sim_time': 'True',
'params_file': new_yaml,
Expand Down
1 change: 0 additions & 1 deletion nav2_system_tests/src/costmap_filters/test_speed_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def generate_launch_description():
),
launch_arguments={
'namespace': '',
'use_namespace': 'False',
'map': map_yaml_file,
'use_sim_time': 'True',
'params_file': new_yaml,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def generate_launch_description():
),
launch_arguments={
'namespace': '',
'use_namespace': 'False',
'use_sim_time': 'True',
'params_file': configured_params,
'use_composition': 'False',
Expand Down
1 change: 0 additions & 1 deletion nav2_system_tests/src/system/test_system_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def generate_launch_description():
),
launch_arguments={
'namespace': '',
'use_namespace': 'False',
'map': map_yaml_file,
'use_sim_time': 'True',
'params_file': new_yaml,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def generate_launch_description():
),
launch_arguments={
'namespace': '',
'use_namespace': 'False',
'map': map_yaml_file,
'use_sim_time': 'True',
'params_file': new_yaml,
Expand Down
Loading

0 comments on commit 7ad9241

Please sign in to comment.