|
4 | 4 |
|
5 | 5 | from launch import LaunchDescription
|
6 | 6 | from launch.actions import DeclareLaunchArgument
|
7 |
| -from launch.conditions import IfCondition |
| 7 | +from launch.conditions import IfCondition, LaunchConfigurationEquals, LaunchConfigurationNotEquals |
8 | 8 | from launch.substitutions import LaunchConfiguration
|
9 | 9 |
|
10 | 10 | from launch_ros.actions import Node
|
@@ -40,6 +40,19 @@ def generate_launch_description():
|
40 | 40 | ],
|
41 | 41 | output="screen",
|
42 | 42 | emulate_tty=True,
|
| 43 | + condition=LaunchConfigurationEquals(LaunchConfiguration("params_file"), "") |
| 44 | + ) |
| 45 | + |
| 46 | + # map publisher node with params file |
| 47 | + map_publisher_with_param_file = Node( |
| 48 | + package="grid_map_geo", |
| 49 | + namespace="grid_map_geo", |
| 50 | + executable="map_publisher", |
| 51 | + name="map_publisher", |
| 52 | + parameters=[LaunchConfiguration("params_file")], |
| 53 | + output="screen", |
| 54 | + emulate_tty=True, |
| 55 | + condition=LaunchConfigurationNotEquals(LaunchConfiguration("params_file"), "") |
43 | 56 | )
|
44 | 57 |
|
45 | 58 | # rviz node
|
@@ -73,8 +86,22 @@ def generate_launch_description():
|
73 | 86 | default_value=f'{Path(pkg_grid_map_geo) / "resources" / default_gdal_color_dataset}',
|
74 | 87 | description="Full path to the elevation texture file.",
|
75 | 88 | ),
|
| 89 | + DeclareLaunchArgument( |
| 90 | + "gdal_dataset_color_path", |
| 91 | + default_value=os.path.join( |
| 92 | + pkg_grid_map_geo, "resources", default_gdal_color_dataset |
| 93 | + ), |
| 94 | + description="Full path to the elevation texture file.", |
| 95 | + ), |
| 96 | + DeclareLaunchArgument( |
| 97 | + "params_file", |
| 98 | + default_value="", |
| 99 | + description="YAML parameter file path.", |
| 100 | + ), |
| 101 | + |
76 | 102 | static_transform_publisher,
|
77 | 103 | map_publisher,
|
| 104 | + map_publisher_with_param_file, |
78 | 105 | rviz,
|
79 | 106 | ]
|
80 | 107 | )
|
|
0 commit comments