15from launch
import LaunchDescription
16from launch_ros.actions
import Node
17from ament_index_python
import get_package_share_directory
18from launch.actions
import Shutdown
19from carma_ros2_utils.launch.get_log_level
import GetLogLevel
20from launch.substitutions
import EnvironmentVariable
21from launch.actions
import DeclareLaunchArgument
22from launch.substitutions
import LaunchConfiguration
23from launch_ros.actions
import ComposableNodeContainer
24from launch_ros.descriptions
import ComposableNode
25from carma_ros2_utils.launch.get_log_level
import GetLogLevel
26from carma_ros2_utils.launch.get_current_namespace
import GetCurrentNamespace
27from launch.conditions
import IfCondition
33 Launch the subsystem controller for the hardware interface subsystem.
34 The actual drivers will
not be launched
in this file
and will instead be launched
in the carma-config.
37 vehicle_config_param_file = LaunchConfiguration('vehicle_config_param_file')
38 declare_vehicle_config_param_file_arg = DeclareLaunchArgument(
39 name =
'vehicle_config_param_file',
40 default_value =
"/opt/carma/vehicle/config/VehicleConfigParams.yaml",
41 description =
"Path to file contain vehicle configuration parameters"
44 use_sim_time = LaunchConfiguration(
'use_sim_time')
45 declare_use_sim_time_arg = DeclareLaunchArgument(
46 name =
'use_sim_time',
47 default_value =
"False",
48 description =
"True if simulation mode is on"
52 env_log_levels = EnvironmentVariable(
'CARMA_ROS_LOGGING_CONFIG', default_value=
'{ "default_level" : "WARN" }')
54 subsystem_controller_default_param_file = os.path.join(
55 get_package_share_directory(
'subsystem_controllers'),
'config/drivers_controller_config.yaml')
57 subsystem_controller_param_file = LaunchConfiguration(
'subsystem_controller_param_file')
58 declare_subsystem_controller_param_file_arg = DeclareLaunchArgument(
59 name =
'subsystem_controller_param_file',
60 default_value = subsystem_controller_default_param_file,
61 description =
"Path to file containing override parameters for the subsystem controller"
64 lightbar_manager_param_file = os.path.join(
65 get_package_share_directory(
'lightbar_manager'),
'config/params.yaml')
67 lightbar_manager_container = ComposableNodeContainer(
68 package=
'carma_ros2_utils',
69 name=
'lightbar_manager_container',
70 executable=
'lifecycle_component_wrapper_mt',
71 namespace=GetCurrentNamespace(),
72 composable_node_descriptions=[
74 package=
'lightbar_manager',
75 plugin=
'lightbar_manager::LightBarManager',
76 name=
'lightbar_manager',
78 {
'use_intra_process_comms':
True},
79 {
'--log-level' : GetLogLevel(
'lightbar_manager', env_log_levels) },
80 {
'is_lifecycle_node':
True}
83 (
"state", [ EnvironmentVariable(
'CARMA_GUIDE_NS', default_value=
''),
"/state" ] ),
84 (
"set_lights", [ EnvironmentVariable(
'CARMA_INTR_NS', default_value=
''),
"/lightbar/set_lights" ] )
87 lightbar_manager_param_file,
88 vehicle_config_param_file
95 subsystem_controller = Node(
96 package=
'subsystem_controllers',
97 name=
'drivers_controller',
98 executable=
'drivers_controller',
100 subsystem_controller_default_param_file,
101 subsystem_controller_param_file,
102 {
"use_sim_time" : use_sim_time}],
104 arguments=[
'--ros-args',
'--log-level', GetLogLevel(
'subsystem_controllers', env_log_levels)]
107 return LaunchDescription([
108 declare_subsystem_controller_param_file_arg,
109 declare_vehicle_config_param_file_arg,
110 declare_use_sim_time_arg,
111 lightbar_manager_container,
112 subsystem_controller,
def generate_launch_description()