17from ament_index_python.packages
import get_package_share_directory
19from launch
import LaunchDescription
20from launch.actions
import DeclareLaunchArgument, IncludeLaunchDescription
21from launch.launch_description_sources
import PythonLaunchDescriptionSource
22from launch.substitutions
import LaunchConfiguration
32 use_sim_time = LaunchConfiguration(
"use_sim_time")
41 slam_toolbox_dir = get_package_share_directory(
"slam_toolbox")
43 slam_launch_file = os.path.join(slam_toolbox_dir,
"launch",
"online_sync_launch.py")
56 declare_namespace_cmd = DeclareLaunchArgument(
57 "namespace", default_value=
"", description=
"Top-level namespace"
65 declare_use_sim_time_cmd = DeclareLaunchArgument(
66 "use_sim_time", default_value=
"True", description=
"Use simulation (Gazebo) clock if true"
69 declare_autostart_cmd = DeclareLaunchArgument(
70 "autostart", default_value=
"True", description=
"Automatically startup the nav2 stack"
95 start_slam_toolbox_cmd = IncludeLaunchDescription(
96 PythonLaunchDescriptionSource(slam_launch_file),
97 launch_arguments={
"use_sim_time": use_sim_time}.items(),
104 ld = LaunchDescription()
107 ld.add_action(declare_namespace_cmd)
109 ld.add_action(declare_use_sim_time_cmd)
110 ld.add_action(declare_autostart_cmd)
119 ld.add_action(start_slam_toolbox_cmd)
def generate_launch_description()