rviz_launch.py
Go to the documentation of this file.
1 # Copyright 2023 Ekumen, Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 from pathlib import Path
16 
17 from ament_index_python.packages import get_package_share_directory
18 
19 from launch import LaunchDescription
20 from launch.actions import DeclareLaunchArgument
21 from launch.actions import GroupAction
22 from launch.substitutions import LaunchConfiguration
23 from launch_ros.actions import Node
24 
25 from launch_ros.actions import SetParameter
26 
27 
29  example_dir = get_package_share_directory('beluga_example')
30  example_dir_path = Path(example_dir)
31 
32  declare_display_config = DeclareLaunchArgument(
33  'display_config',
34  default_value=str(example_dir_path / 'rviz' / 'rviz.rviz'),
35  description='A display config file (.rviz) to load.',
36  )
37 
38  load_nodes = GroupAction(
39  actions=[
40  SetParameter('use_sim_time', True),
41  Node(
42  package='rviz2',
43  executable='rviz2',
44  name='rviz2',
45  output='own_log',
46  arguments=[
47  '--display-config',
48  LaunchConfiguration('display_config'),
49  ],
50  ),
51  ]
52  )
53 
54  return LaunchDescription([declare_display_config, load_nodes])
rviz_launch.generate_launch_description
def generate_launch_description()
Definition: rviz_launch.py:28


beluga_example
Author(s):
autogenerated on Tue Jul 16 2024 03:00:09