-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathdemo_map_server_from_mm.launch.py
43 lines (37 loc) · 1.28 KB
/
demo_map_server_from_mm.launch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# ROS 2 launch file for example in mrpt_tutorials
#
# See repo online: https://github.com/mrpt-ros-pkg/mrpt_navigation
#
from launch import LaunchDescription
from launch.substitutions import TextSubstitution
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from ament_index_python import get_package_share_directory
from launch.launch_description_sources import PythonLaunchDescriptionSource
import os
def generate_launch_description():
tutsDir = get_package_share_directory("mrpt_tutorials")
arg_mm_file = DeclareLaunchArgument(
name='mm_file'
)
mrpt_map_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource([os.path.join(
get_package_share_directory('mrpt_map_server'), 'launch',
'mrpt_map_server.launch.py')]),
launch_arguments={
'mm_file': LaunchConfiguration('mm_file'),
}.items()
)
rviz2_node = Node(
package='rviz2',
executable='rviz2',
name='rviz2',
arguments=[
'-d', [os.path.join(tutsDir, 'rviz2', 'gridmap.rviz')]]
)
return LaunchDescription([
mrpt_map_launch,
arg_mm_file,
rviz2_node
])