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

parametrised map file when launching navigation #12

Merged
merged 1 commit into from
Dec 4, 2023
Merged
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
11 changes: 11 additions & 0 deletions src/limo_navigation/launch/limo_navigation.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ def generate_launch_description():
# Get the launch directory
launch_dir = os.path.join(
get_package_share_directory('limo_navigation'), 'launch')
maps_dir = os.path.join(
get_package_share_directory('limo_navigation'), 'maps')


# Create the launch configuration variables
namespace = LaunchConfiguration('namespace')
use_sim_time = LaunchConfiguration('use_sim_time')
autostart = LaunchConfiguration('autostart')
map_yaml_file = LaunchConfiguration('map')

lifecycle_nodes = [
'map_server',
Expand All @@ -39,6 +43,11 @@ def generate_launch_description():
'autostart', default_value='true',
description='Automatically startup the nav2 stack')

declare_map = DeclareLaunchArgument(
'map',
default_value=os.path.join(maps_dir, 'simple_map.yaml'),
description='Full path to map yaml file to load')

launch_limo_localization = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_dir, 'limo_localization.launch.py')),
Expand All @@ -47,6 +56,7 @@ def generate_launch_description():
'use_sim_time': use_sim_time,
'use_lifecycle_mgr': 'false',
'use_rviz': 'false',
'map': map_yaml_file,
}.items())

launch_limo_controller = IncludeLaunchDescription(
Expand Down Expand Up @@ -74,6 +84,7 @@ def generate_launch_description():
ld.add_action(declare_use_sim_time)
ld.add_action(declare_autostart)
ld.add_action(declare_namespace)
ld.add_action(declare_map)

ld.add_action(launch_limo_localization)
ld.add_action(launch_limo_controller)
Expand Down