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.
localization_controller.hpp
Go to the documentation of this file.
1#pragma once
2
3/*
4 * Copyright (C) 2021 LEIDOS.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 * use this file except in compliance with the License. You may obtain a copy of
8 * the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 * License for the specific language governing permissions and limitations under
16 * the License.
17 */
18
19#include <memory>
20
21#include "carma_msgs/msg/system_alert.hpp"
22#include "ros2_lifecycle_manager/ros2_lifecycle_manager.hpp"
23#include "rclcpp/rclcpp.hpp"
26
28{
29
31 {
32 public:
34
36
42 explicit LocalizationControllerNode(const rclcpp::NodeOptions &options);
43
45 // Overrides
47 void on_system_alert(const carma_msgs::msg::SystemAlert::UniquePtr msg);
48 carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &prev_state);
49
50 protected:
55 std::unordered_map<std::vector<SensorBooleanStatus>, SensorAlertStatus, VectorHash> sensor_fault_map_from_json(std::string json_string);
56
57 // A map of sensor node names to their status and index in the config_.sensor_nodes list
58 std::unordered_map<std::string, SensorBooleanStatus> sensor_status_;
60
61 // TODO The ROS1 localization manager functionality should be updated to properly interact with or exist in this node
62 // https://github.com/usdot-fhwa-stol/carma-platform/issues/1498
63
64 };
65
66} // namespace subsystem_controllers
A base class for all subsystem_controllers which provides default lifecycle behavior for subsystems.
std::unordered_map< std::vector< SensorBooleanStatus >, SensorAlertStatus, VectorHash > sensor_fault_map_from_json(std::string json_string)
Helper function to convert a json string into an unordered map of sensor status's to required alerts ...
std::unordered_map< std::string, SensorBooleanStatus > sensor_status_
void on_system_alert(const carma_msgs::msg::SystemAlert::UniquePtr msg)
carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &prev_state)
Stuct containing the algorithm configuration values for the BaseSubsystemController.