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.
traffic_incident_parser_node.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020-2022 LEIDOS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16
17#pragma once
18
19#include <rclcpp/rclcpp.hpp>
20#include <functional>
21#include <string>
25
26#include <carma_ros2_utils/carma_lifecycle_node.hpp>
27
29{
30
37 class TrafficIncidentParserNode : public carma_ros2_utils::CarmaLifecycleNode
38 {
39
40 private:
41 // Subscribers
42 carma_ros2_utils::SubPtr<std_msgs::msg::String> projection_sub_;
43 carma_ros2_utils::SubPtr<carma_v2x_msgs::msg::MobilityOperation> mobility_operation_sub_;
44
45 // Publishers
46 carma_ros2_utils::PubPtr<carma_v2x_msgs::msg::TrafficControlMessage> traffic_control_msg_pub_;
47
48 // World Model Listener; must be declared before traffic_parser_worker_ for proper initialization
49 std::shared_ptr<carma_wm::WMListener> wm_listener_;
50
51 // TrafficIncidentParserWorker class object
52 std::shared_ptr<TrafficIncidentParserWorker> traffic_parser_worker_;
53
54 public:
55
59 explicit TrafficIncidentParserNode(const rclcpp::NodeOptions &);
60
62 // Overrides
64 carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &);
65
69 void publishTrafficControlMessage(const carma_v2x_msgs::msg::TrafficControlMessage& traffic_control_msg) const;
70 };
71
72} // traffic_incident_parser
The class responsible for processing incoming MobilityOperation messages with strategy "carma3/Incide...
carma_ros2_utils::SubPtr< std_msgs::msg::String > projection_sub_
void publishTrafficControlMessage(const carma_v2x_msgs::msg::TrafficControlMessage &traffic_control_msg) const
Publish traffic control message.
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::TrafficControlMessage > traffic_control_msg_pub_
std::shared_ptr< TrafficIncidentParserWorker > traffic_parser_worker_
TrafficIncidentParserNode(const rclcpp::NodeOptions &)
TrafficIncidentParserNode constructor.
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::MobilityOperation > mobility_operation_sub_
carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &)