demo_jackal.launch.py
Go to the documentation of this file.
1 
2 # ROS2 launch file
3 
4 from launch import LaunchDescription
5 from launch.substitutions import TextSubstitution
6 from launch.substitutions import LaunchConfiguration
7 from launch_ros.actions import Node
8 from launch.actions import DeclareLaunchArgument
9 from ament_index_python import get_package_share_directory
10 import os
11 
12 
14  mvsimDir = get_package_share_directory("mvsim")
15  # print('mvsimDir: ' + mvsimDir)
16 
17  # args that can be set from the command line or a default will be used
18  world_file_launch_arg = DeclareLaunchArgument(
19  "world_file", default_value=TextSubstitution(
20  text=os.path.join(mvsimDir, 'mvsim_tutorial', 'demo_jackal.world.xml')))
21  do_fake_localization_arg = DeclareLaunchArgument(
22  "do_fake_localization", default_value='True', description='publish tf odom -> base_link')
23 
24  mvsim_node = Node(
25  package='mvsim',
26  executable='mvsim_node',
27  name='mvsim',
28  output='screen',
29  parameters=[
30  os.path.join(mvsimDir, 'mvsim_tutorial',
31  'mvsim_ros2_params.yaml'),
32  {
33  "world_file": LaunchConfiguration('world_file'),
34  "headless": False,
35  "do_fake_localization": LaunchConfiguration('do_fake_localization'),
36  }]
37  )
38 
39  rviz2_node = Node(
40  package='rviz2',
41  executable='rviz2',
42  name='rviz2',
43  arguments=[
44  '-d', [os.path.join(mvsimDir, 'mvsim_tutorial', 'demo_depth_camera_ros2.rviz')]]
45  )
46 
47  return LaunchDescription([
48  world_file_launch_arg,
49  do_fake_localization_arg,
50  mvsim_node,
51  rviz2_node
52  ])
demo_jackal.generate_launch_description
def generate_launch_description()
Definition: demo_jackal.launch.py:13


mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:07