Carma-platform v4.2.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.
external_object.py
Go to the documentation of this file.
1# Copyright (C) 2021 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 launch.substitutions import LaunchConfiguration
20from launch.actions import DeclareLaunchArgument
21
22import os
23
24'''
25This file is can be used to launch the CARMA object_detection_tracking_node.
26 Though in carma-platform is may be loaded as a component instead of a separate node
27'''
28
29def generate_launch_description():
30
31 # Declare the log_level launch argument
32 log_level = LaunchConfiguration('log_level')
33 declare_log_level_arg = DeclareLaunchArgument(
34 name ='log_level', default_value='WARN')
35
36 param_file_path = os.path.join(
37 get_package_share_directory('object_detection_tracking'), 'config/parameters.yaml')
38
39 container = ComposableNodeContainer(
40 package='rclcpp_components',
41 name='external_object_container',
42 namespace='/',
43 executable='component_container_mt',
44 composable_node_descriptions=[
45
46 ComposableNode(
47 package='object_detection_tracking',
48 plugin='object::ObjectDetectionTrackingNode',
49 name='external_object',
50 namespace="/",
51 extra_arguments=[
52 {'use_intra_process_comms': True},
53 {'--log-level' : log_level }
54 ],
55 parameters=[ param_file_path ]
56 ),
57 ]
58 )
59
60 return LaunchDescription([
61 declare_log_level_arg,
62 container
63 ])