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.
ui.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.substitutions import EnvironmentVariable
18from launch.substitutions import LaunchConfiguration
19from launch.actions import DeclareLaunchArgument
20from launch.actions import IncludeLaunchDescription
21from launch.launch_description_sources import AnyLaunchDescriptionSource
22from launch.substitutions import EnvironmentVariable
23from launch.actions import GroupAction
24from launch_ros.actions.set_remap import SetRemap
25
26import os
27
29 """
30 UI/Ros_bridge nodes.
31 """
32 env_log_levels = EnvironmentVariable('CARMA_ROS_LOGGING_CONFIG', default_value='{ "default_level" : "WARN" }')
33
34 port = LaunchConfiguration('port')
35 declare_port = DeclareLaunchArgument(
36 name = 'port',
37 default_value = "9090",
38 description = "The default port for rosbridge is 9090"
39 )
40
41 rosbridge_server_group = GroupAction(
42 actions=[
43 SetRemap("get_available_routes",[EnvironmentVariable('CARMA_GUIDE_NS', default_value=''),"/get_available_routes"]),
44 SetRemap("set_active_route",[EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/set_active_route"]),
45 SetRemap("start_active_route",[EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/start_active_route"]),
46 SetRemap("get_available_routes", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/get_available_routes"]),
47 SetRemap("route_state", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/route_state"]),
48 SetRemap("route_event", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/route_event"]),
49 SetRemap("route", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/route"]),
50 SetRemap("get_system_version", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/get_system_version"]),
51 SetRemap("state", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/state"]),
52 SetRemap("ui_platoon_vehicle_info", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/ui_platoon_vehicle_info"]),
53 SetRemap("plugins/available_plugins", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/plugins/available_plugins"]),
54 SetRemap("plugins/get_registered_plugins", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/plugins/get_registered_plugins"]),
55 SetRemap("plugins/activate_plugin", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/plugins/activate_plugin"]),
56 SetRemap("get_available_routes", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/get_available_routes"]),
57 SetRemap("set_guidance_active", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/set_guidance_active"]),
58 SetRemap("plugins/controlling_plugins", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/plugins/controlling_plugins"]),
59 SetRemap("traffic_signal_info", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/traffic_signal_info"]),
60 SetRemap("platooning_info", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/platooning_info"]),
61 SetRemap("traffic_signal_info", [EnvironmentVariable('CARMA_GUIDE_NS', default_value=''), "/traffic_signal_info"]),
62 SetRemap("system_alert", "/system_alert"),
63 SetRemap("bsm", [EnvironmentVariable('CARMA_MSG_NS', default_value=''), "/incoming_bsm"]),
64 SetRemap("nav_sat_fix", [EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/gnss/nav_sat_fix"]),
65 SetRemap("velocity", [EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/vehicle/twist"]),
66 SetRemap("driver_discovery", [EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/driver_discovery"]),
67 SetRemap("get_drivers_with_capabilities", [EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/get_drivers_with_capabilities"]),
68 SetRemap("controller/robotic_status", [EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/controller/robot_status"]),
69 SetRemap("controller/vehicle_cmd" , [EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/controller/vehicle_cmd"]),
70 SetRemap("comms/outbound_binary_msg",[EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/comms/outbound_binary_msg"]),
71 SetRemap("comms/inbound_binary_msg", [EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/comms/inbound_binary_msg"]),
72 SetRemap("can/engine_speed", [EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/can/engine_speed"]),
73 SetRemap("can/speed", [EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/can/speed"]),
74 SetRemap("can/acc_engaged", [EnvironmentVariable('CARMA_INTR_NS', default_value=''), "/can/acc_engaged"]),
75 IncludeLaunchDescription(
76 AnyLaunchDescriptionSource(
77 [ get_package_share_directory('rosbridge_server'), '/launch/rosbridge_websocket_launch.xml']
78 ),
79 launch_arguments = {
80 'port' : port,
81 }.items()
82 ),
83 ]
84 )
85
86 return LaunchDescription([
87 declare_port,
88 rosbridge_server_group
89 ])
90
91
def generate_launch_description()
Definition: ui.launch.py:28