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.
pure_pursuit_wrapper.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");
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 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.actions import DeclareLaunchArgument
20from launch.substitutions import LaunchConfiguration
21from carma_ros2_utils.launch.get_current_namespace import GetCurrentNamespace
22
23import os
24
25'''
26This file is can be used to launch the CARMA Pure Pursuit Wrapper Node.
27 Though in carma-platform it may be launched directly from the base launch file.
28'''
29
30def generate_launch_description():
31
32 # Declare the log_level launch argument
33 log_level = LaunchConfiguration('log_level')
34 declare_log_level_arg = DeclareLaunchArgument(
35 name ='log_level', default_value='WARN')
36
37 carma_pure_pursuit_wrapper_container = ComposableNodeContainer(
38 package='carma_ros2_utils',
39 name='carma_pure_pursuit_wrapper_container',
40 executable='carma_component_container_mt',
41 namespace=GetCurrentNamespace(),
42 composable_node_descriptions=[
43 ComposableNode(
44 package='pure_pursuit_wrapper',
45 plugin='pure_pursuit_wrapper::PurePursuitWrapperNode',
46 name='pure_pursuit_wrapper',
47 extra_arguments=[
48 {'use_intra_process_comms': True},
49 {'--log-level' : log_level }
50 ]
51 )
52 ]
53 )
54
55 return LaunchDescription([
56 declare_log_level_arg,
57 carma_pure_pursuit_wrapper_container
58 ])