Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
891762f
Fix standard flake8 errors for `tools
nachovizzo Nov 5, 2023
c295f72
Fix flake8 tests for nav2_common
nachovizzo Nov 5, 2023
5c60e2c
Fix flake8 nav2_common linterr
nachovizzo Nov 5, 2023
1c8e02d
Fix flake8 nav2_common linter
nachovizzo Nov 5, 2023
6d601f5
Fix flake8 nav_common linter
nachovizzo Nov 5, 2023
4eeb19a
Fix nav2_system_tests flake8 linter
nachovizzo Nov 5, 2023
58b5cb2
Fix flake8-builtins linter
nachovizzo Nov 5, 2023
bebf54d
Fix flake8-comprehensions linter
nachovizzo Nov 5, 2023
62f2292
Fix flake8-import-order linter for nav2_sumple_commander
nachovizzo Nov 5, 2023
10c7819
Fix flake8-import-order linter for nav2_system_tests
nachovizzo Nov 5, 2023
21a995d
Fix flake8-import-order linter for nav2_common
nachovizzo Nov 5, 2023
033f80f
Fix flake8-import-order linter for tools
nachovizzo Nov 5, 2023
ad85fac
Fix flake8-docstring linter
nachovizzo Nov 5, 2023
36d70f0
Fix flake8-quotes linter for nav2_common
nachovizzo Nov 5, 2023
4484d6d
Fix flake8-quotes linter for nav2_system_tests
nachovizzo Nov 5, 2023
551ac22
Fix flake8-quotes linter for nav2_collision_monitor
nachovizzo Nov 5, 2023
5ab718e
Fix flake8-quotes linter for nav2_map_server
nachovizzo Nov 5, 2023
2dd174f
Fix flake8-quotes linter for nav2_bringup
nachovizzo Nov 5, 2023
0c6a0bb
Fix flake8-quotes linter for tools
nachovizzo Nov 5, 2023
57509a9
Fix flake8-quotes linter for nav2_simple_commander
nachovizzo Nov 5, 2023
e584911
Fix flake8-quotes linter for nav2_lifecycle
nachovizzo Nov 5, 2023
cc213f4
Fix flake8-quotes linter for nav2_costmap2d
nachovizzo Nov 5, 2023
66502df
Fix flake8-quotes linter for nav2_smac_planner
nachovizzo Nov 5, 2023
e17b196
Fix linter... again
nachovizzo Nov 5, 2023
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
134 changes: 67 additions & 67 deletions nav2_bringup/launch/bringup_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,36 @@

def generate_launch_description():
# Get the launch directory
bringup_dir = get_package_share_directory("nav2_bringup")
launch_dir = os.path.join(bringup_dir, "launch")
bringup_dir = get_package_share_directory('nav2_bringup')
launch_dir = os.path.join(bringup_dir, 'launch')

# 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")
params_file = LaunchConfiguration("params_file")
autostart = LaunchConfiguration("autostart")
use_composition = LaunchConfiguration("use_composition")
use_respawn = LaunchConfiguration("use_respawn")
log_level = LaunchConfiguration("log_level")
namespace = LaunchConfiguration('namespace')
use_namespace = LaunchConfiguration('use_namespace')
slam = LaunchConfiguration('slam')
map_yaml_file = LaunchConfiguration('map')
use_sim_time = LaunchConfiguration('use_sim_time')
params_file = LaunchConfiguration('params_file')
autostart = LaunchConfiguration('autostart')
use_composition = LaunchConfiguration('use_composition')
use_respawn = LaunchConfiguration('use_respawn')
log_level = LaunchConfiguration('log_level')

# Map fully qualified names to relative ones so the node's namespace can be prepended.
# In case of the transforms (tf), currently, there doesn't seem to be a better alternative
# https://github.com/ros/geometry2/issues/32
# https://github.com/ros/robot_state_publisher/pull/30
# TODO(orduno) Substitute with `PushNodeRemapping`
# https://github.com/ros2/launch_ros/issues/56
remappings = [("/tf", "tf"), ("/tf_static", "tf_static")]
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)},
replacements={'<robot_namespace>': ('/', namespace)},
condition=IfCondition(use_namespace),
)

Expand All @@ -78,59 +78,59 @@ def generate_launch_description():
)

stdout_linebuf_envvar = SetEnvironmentVariable(
"RCUTILS_LOGGING_BUFFERED_STREAM", "1"
'RCUTILS_LOGGING_BUFFERED_STREAM', '1'
)

declare_namespace_cmd = DeclareLaunchArgument(
"namespace", default_value="", description="Top-level namespace"
'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",
'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"
'slam', default_value='False', description='Whether run a SLAM'
)

declare_map_yaml_cmd = DeclareLaunchArgument(
"map", default_value="", description="Full path to map yaml file to load"
'map', default_value='', description='Full path to map yaml file to load'
)

declare_use_sim_time_cmd = DeclareLaunchArgument(
"use_sim_time",
default_value="false",
description="Use simulation (Gazebo) clock if true",
'use_sim_time',
default_value='false',
description='Use simulation (Gazebo) clock if true',
)

declare_params_file_cmd = DeclareLaunchArgument(
"params_file",
default_value=os.path.join(bringup_dir, "params", "nav2_params.yaml"),
description="Full path to the ROS2 parameters file to use for all launched nodes",
'params_file',
default_value=os.path.join(bringup_dir, 'params', 'nav2_params.yaml'),
description='Full path to the ROS2 parameters file to use for all launched nodes',
)

declare_autostart_cmd = DeclareLaunchArgument(
"autostart",
default_value="true",
description="Automatically startup the nav2 stack",
'autostart',
default_value='true',
description='Automatically startup the nav2 stack',
)

declare_use_composition_cmd = DeclareLaunchArgument(
"use_composition",
default_value="True",
description="Whether to use composed bringup",
'use_composition',
default_value='True',
description='Whether to use composed bringup',
)

declare_use_respawn_cmd = DeclareLaunchArgument(
"use_respawn",
default_value="False",
description="Whether to respawn if a node crashes. Applied when composition is disabled.",
'use_respawn',
default_value='False',
description='Whether to respawn if a node crashes. Applied when composition is disabled.',
)

declare_log_level_cmd = DeclareLaunchArgument(
"log_level", default_value="info", description="log level"
'log_level', default_value='info', description='log level'
)

# Specify the actions
Expand All @@ -139,55 +139,55 @@ def generate_launch_description():
PushROSNamespace(condition=IfCondition(use_namespace), namespace=namespace),
Node(
condition=IfCondition(use_composition),
name="nav2_container",
package="rclcpp_components",
executable="component_container_isolated",
parameters=[configured_params, {"autostart": autostart}],
arguments=["--ros-args", "--log-level", log_level],
name='nav2_container',
package='rclcpp_components',
executable='component_container_isolated',
parameters=[configured_params, {'autostart': autostart}],
arguments=['--ros-args', '--log-level', log_level],
remappings=remappings,
output="screen",
output='screen',
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_dir, "slam_launch.py")
os.path.join(launch_dir, 'slam_launch.py')
),
condition=IfCondition(slam),
launch_arguments={
"namespace": namespace,
"use_sim_time": use_sim_time,
"autostart": autostart,
"use_respawn": use_respawn,
"params_file": params_file,
'namespace': namespace,
'use_sim_time': use_sim_time,
'autostart': autostart,
'use_respawn': use_respawn,
'params_file': params_file,
}.items(),
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_dir, "localization_launch.py")
os.path.join(launch_dir, 'localization_launch.py')
),
condition=IfCondition(PythonExpression(["not ", slam])),
condition=IfCondition(PythonExpression(['not ', slam])),
launch_arguments={
"namespace": namespace,
"map": map_yaml_file,
"use_sim_time": use_sim_time,
"autostart": autostart,
"params_file": params_file,
"use_composition": use_composition,
"use_respawn": use_respawn,
"container_name": "nav2_container",
'namespace': namespace,
'map': map_yaml_file,
'use_sim_time': use_sim_time,
'autostart': autostart,
'params_file': params_file,
'use_composition': use_composition,
'use_respawn': use_respawn,
'container_name': 'nav2_container',
}.items(),
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_dir, "navigation_launch.py")
os.path.join(launch_dir, 'navigation_launch.py')
),
launch_arguments={
"namespace": namespace,
"use_sim_time": use_sim_time,
"autostart": autostart,
"params_file": params_file,
"use_composition": use_composition,
"use_respawn": use_respawn,
"container_name": "nav2_container",
'namespace': namespace,
'use_sim_time': use_sim_time,
'autostart': autostart,
'params_file': params_file,
'use_composition': use_composition,
'use_respawn': use_respawn,
'container_name': 'nav2_container',
}.items(),
),
]
Expand Down
Loading