Carma-platform v4.11.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
trajectory_executor_launch.py
Go to the documentation of this file.
1# Copyright (C) 2022 LEIDOS.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# 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, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15from ament_index_python import get_package_share_directory
16from launch import LaunchDescription
17from launch_ros.actions import ComposableNodeContainer
18from launch_ros.descriptions import ComposableNode
19from carma_ros2_utils.launch.get_current_namespace import GetCurrentNamespace
20
21import os
22
23'''
24This file is can be used to launch the CARMA trajectory_executor_node.
25 Though in carma-platform it may be launched directly from the base launch file.
26'''
27
28
29def generate_launch_description():
30
31 # Get parameter file path
32 param_file_path = os.path.join(
33 get_package_share_directory('trajectory_executor'), 'config/parameters.yaml')
34
35 # Launch node(s) in a carma container to allow logging to be configured
36 container = ComposableNodeContainer(
37 package='carma_ros2_utils',
38 name='trajectory_executor_container',
39 namespace=GetCurrentNamespace(),
40 executable='carma_component_container_mt',
41 composable_node_descriptions=[
42
43 # Launch the core node(s)
44 ComposableNode(
45 package='trajectory_executor',
46 plugin='trajectory_executor::TrajectoryExecutor',
47 name='trajectory_executor_node',
48 extra_arguments=[
49 {'use_intra_process_comms': True},
50 ],
51 parameters=[ param_file_path ]
52 ),
53 ]
54 )
55
56 return LaunchDescription([
57 container
58 ])