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.
roadway_objects_launch.py
Go to the documentation of this file.
1# Copyright 2019-2023 Leidos
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
15from launch import LaunchDescription
16from launch_ros.actions import ComposableNodeContainer
17from launch_ros.descriptions import ComposableNode
18from launch.actions import DeclareLaunchArgument
19from launch.substitutions import LaunchConfiguration
20from carma_ros2_utils.launch.get_current_namespace import GetCurrentNamespace
21
22
23"""
24This file is can be used to launch the CARMA roadway_objects_node.
25 Though in carma-platform it may be launched directly from the base launch file.
26"""
27
28
29def generate_launch_description():
30 # Declare the log_level launch argument
31 log_level = LaunchConfiguration("log_level")
32 declare_log_level_arg = DeclareLaunchArgument(
33 name="log_level", default_value="WARN"
34 )
35
36 # Launch node(s) in a carma container to allow logging to be configured
37 container = ComposableNodeContainer(
38 package="carma_ros2_utils",
39 name="roadway_objects_container",
40 namespace=GetCurrentNamespace(),
41 executable="carma_component_container_mt",
42 composable_node_descriptions=[
43 # Launch the core node(s)
44 ComposableNode(
45 package="roadway_objects",
46 plugin="roadway_objects::RoadwayObjectsNode",
47 name="roadway_objects_node",
48 extra_arguments=[
49 {"use_intra_process_comms": True},
50 {"--log-level": log_level},
51 ],
52 ),
53 ],
54 )
55
56 return LaunchDescription([declare_log_level_arg, container])