18from launch
import LaunchDescription
19from launch.actions
import DeclareLaunchArgument
20from launch.substitutions
import LaunchConfiguration
21from launch_ros.actions
import Node
22from ament_index_python.packages
import get_package_share_directory
26 use_sim_time = LaunchConfiguration(
"use_sim_time")
27 slam_params_file = LaunchConfiguration(
"slam_params_file")
29 declare_use_sim_time_argument = DeclareLaunchArgument(
30 "use_sim_time", default_value=
"true", description=
"Use simulation/Gazebo clock"
32 declare_slam_params_file_cmd = DeclareLaunchArgument(
34 default_value=os.path.join(
35 get_package_share_directory(
"sm_aws_warehouse_navigation"),
37 "mapper_params_online_sync.yaml",
39 description=
"Full path to the ROS2 parameters file to use for the slam_toolbox node",
42 start_sync_slam_toolbox_node = Node(
43 parameters=[slam_params_file, {
"use_sim_time": use_sim_time}],
44 package=
"slam_toolbox",
45 executable=
"sync_slam_toolbox_node",
50 ld = LaunchDescription()
52 ld.add_action(declare_use_sim_time_argument)
53 ld.add_action(declare_slam_params_file_cmd)
54 ld.add_action(start_sync_slam_toolbox_node)
def generate_launch_description()