SMACC2
online_sync_launch.py
Go to the documentation of this file.
1# Copyright 2021 RobosoftAI Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15from launch import LaunchDescription
16from launch.actions import DeclareLaunchArgument
17from launch.substitutions import LaunchConfiguration
18from launch_ros.actions import Node
19from ament_index_python.packages import get_package_share_directory
20
21
23 use_sim_time = LaunchConfiguration("use_sim_time")
24
25 declare_use_sim_time_argument = DeclareLaunchArgument(
26 "use_sim_time", default_value="true", description="Use simulation/Gazebo clock"
27 )
28
29 xtermprefix = "xterm -xrm 'XTerm*scrollBar: true' -xrm 'xterm*rightScrollBar: true' -hold -geometry 1000x600 -sl 10000 -e"
30
31 start_sync_slam_toolbox_node = Node(
32 parameters=[
33 get_package_share_directory("slam_toolbox") + "/config/mapper_params_online_sync.yaml",
34 {"use_sim_time": use_sim_time},
35 ],
36 package="slam_toolbox",
37 executable="sync_slam_toolbox_node",
38 name="slam_toolbox",
39 output="screen",
40 prefix=xtermprefix,
41 )
42
43 ld = LaunchDescription()
44
45 ld.add_action(declare_use_sim_time_argument)
46 ld.add_action(start_sync_slam_toolbox_node)
47
48 return ld