|
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
|
@@ -77,8 +90,22 @@ def generate_launch_description():
|
77 | 90 | ),
|
78 | 91 | description="Full path to the elevation texture file.",
|
79 | 92 | ),
|
| 93 | + DeclareLaunchArgument( |
| 94 | + "gdal_dataset_color_path", |
| 95 | + default_value=os.path.join( |
| 96 | + pkg_grid_map_geo, "resources", default_gdal_color_dataset |
| 97 | + ), |
| 98 | + description="Full path to the elevation texture file.", |
| 99 | + ), |
| 100 | + DeclareLaunchArgument( |
| 101 | + "params_file", |
| 102 | + default_value="", |
| 103 | + description="YAML parameter file path.", |
| 104 | + ), |
| 105 | + |
80 | 106 | static_transform_publisher,
|
81 | 107 | map_publisher,
|
| 108 | + map_publisher_with_param_file, |
82 | 109 | rviz,
|
83 | 110 | ]
|
84 | 111 | )
|
|
0 commit comments