17 from ament_index_python.packages
import get_package_share_directory
18 from launch
import LaunchDescription
19 from launch.actions
import DeclareLaunchArgument
20 from launch.substitutions
import LaunchConfiguration
21 from launch_ros.actions
import Node
24 def generate_launch_description() -> LaunchDescription:
25 bringup_dir = get_package_share_directory(
'nav2_bringup')
26 params_file = LaunchConfiguration(
'params_file')
27 declare_params_file_cmd = DeclareLaunchArgument(
29 default_value=os.path.join(bringup_dir,
'params',
'nav2_params.yaml'),
30 description=
'Full path to the ROS2 parameters file to use for all launched nodes',
33 scan_frame_id = LaunchConfiguration(
'scan_frame_id')
34 declare_scan_frame_id_cmd = DeclareLaunchArgument(
36 default_value=
'base_scan',
39 loopback_sim_cmd = Node(
40 package=
'nav2_loopback_sim',
41 executable=
'loopback_simulator',
42 name=
'loopback_simulator',
44 parameters=[params_file, {
'scan_frame_id': scan_frame_id}],
47 ld = LaunchDescription()
48 ld.add_action(declare_scan_frame_id_cmd)
49 ld.add_action(declare_params_file_cmd)
50 ld.add_action(loopback_sim_cmd)