Skip to content

Commit

Permalink
initial commit-not tested
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevedan-robotics committed Sep 6, 2022
1 parent 634d2e3 commit c6eb3d9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 48 deletions.
2 changes: 1 addition & 1 deletion nav2_bringup/launch/bringup_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def generate_launch_description():

# Create our own temporary YAML files that include substitutions
param_substitutions = {
'yaml_filename': map_yaml_file}
}

configured_params = RewrittenYaml(
source_file=params_file,
Expand Down
80 changes: 41 additions & 39 deletions nav2_bringup/launch/localization_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ def generate_launch_description():
remappings = [('/tf', 'tf'),
('/tf_static', 'tf_static')]

# Create our own temporary YAML files that include substitutions
param_substitutions = {
'yaml_filename': map_yaml_file}

configured_params = RewrittenYaml(
source_file=params_file,
root_key=namespace,
param_rewrites=param_substitutions,
convert_types=True)

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

Expand Down Expand Up @@ -107,24 +97,30 @@ def generate_launch_description():
condition=IfCondition(PythonExpression(['not ', use_composition])),
actions=[
SetParameter("use_sim_time", use_sim_time),
Node(
package='nav2_map_server',
executable='map_server',
name='map_server',
output='screen',
respawn=use_respawn,
respawn_delay=2.0,
parameters=[configured_params],
arguments=['--ros-args', '--log-level', log_level],
remappings=remappings),
load_map_server_node=GroupAction(
actions=[
SetParameter("yaml_filename", map_yaml_file),
Node(
package='nav2_map_server',
executable='map_server',
name='map_server',
output='screen',
respawn=use_respawn,
respawn_delay=2.0,
parameters=[params_file],
arguments=['--ros-args', '--log-level', log_level],
remappings=remappings),

]
),
Node(
package='nav2_amcl',
executable='amcl',
name='amcl',
output='screen',
respawn=use_respawn,
respawn_delay=2.0,
parameters=[configured_params],
parameters=[params_file],
arguments=['--ros-args', '--log-level', log_level],
remappings=remappings),
Node(
Expand All @@ -145,24 +141,29 @@ def generate_launch_description():
LoadComposableNodes(
target_container=container_name,
composable_node_descriptions=[
ComposableNode(
package='nav2_map_server',
plugin='nav2_map_server::MapServer',
name='map_server',
parameters=[configured_params],
remappings=remappings),
ComposableNode(
package='nav2_amcl',
plugin='nav2_amcl::AmclNode',
name='amcl',
parameters=[configured_params],
remappings=remappings),
ComposableNode(
package='nav2_lifecycle_manager',
plugin='nav2_lifecycle_manager::LifecycleManager',
name='lifecycle_manager_localization',
parameters=[{'autostart': autostart,
'node_names': lifecycle_nodes}]),
load_map_server_node=GroupAction(
actions=[
SetParameter("yaml_filename", map_yaml_file),
ComposableNode(
package='nav2_map_server',
plugin='nav2_map_server::MapServer',
name='map_server',
parameters=[params_file],
remappings=remappings),
)]
),
ComposableNode(
package='nav2_amcl',
plugin='nav2_amcl::AmclNode',
name='amcl',
parameters=[params_file],
remappings=remappings),
ComposableNode(
package='nav2_lifecycle_manager',
plugin='nav2_lifecycle_manager::LifecycleManager',
name='lifecycle_manager_localization',
parameters=[{'autostart': autostart,
'node_names': lifecycle_nodes}]),
],
)
]
Expand All @@ -187,6 +188,7 @@ def generate_launch_description():

# Add the actions to launch all of the localiztion nodes
ld.add_action(load_nodes)
ld.add_action(load_map_server_node)
ld.add_action(load_composable_nodes)

return ld
9 changes: 1 addition & 8 deletions nav2_bringup/launch/slam_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ def generate_launch_description():
slam_toolbox_dir = get_package_share_directory('slam_toolbox')
slam_launch_file = os.path.join(slam_toolbox_dir, 'launch', 'online_sync_launch.py')

# Create our own temporary YAML files that include substitutions
configured_params = RewrittenYaml(
source_file=params_file,
root_key=namespace,
param_rewrites={},
convert_types=True)

# Declare the launch arguments
declare_namespace_cmd = DeclareLaunchArgument(
'namespace',
Expand Down Expand Up @@ -89,7 +82,7 @@ def generate_launch_description():
respawn=use_respawn,
respawn_delay=2.0,
arguments=['--ros-args', '--log-level', log_level],
parameters=[configured_params]),
parameters=[params_file]),
Node(
package='nav2_lifecycle_manager',
executable='lifecycle_manager',
Expand Down

0 comments on commit c6eb3d9

Please sign in to comment.