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