demo_warehouse.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_warehouse.world.xml')))
21 
22  mvsim_node = Node(
23  package='mvsim',
24  executable='mvsim_node',
25  name='mvsim',
26  output='screen',
27  parameters=[
28  os.path.join(mvsimDir, 'mvsim_tutorial',
29  'mvsim_ros2_params.yaml'),
30  {
31  "world_file": LaunchConfiguration('world_file'),
32  "headless": False
33  }]
34  )
35 
36  rviz2_node = Node(
37  package='rviz2',
38  executable='rviz2',
39  name='rviz2',
40  arguments=[
41  '-d', [os.path.join(mvsimDir, 'mvsim_tutorial', 'demo_warehouse_ros2.rviz')]]
42  )
43 
44  return LaunchDescription([
45  world_file_launch_arg,
46  mvsim_node,
47  rviz2_node
48  ])


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:19