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.
external_object_list_to_detection_list_component.hpp
Go to the documentation of this file.
1// Copyright 2023 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
15#ifndef CARMA_COOPERATIVE_PERCEPTION__EXTERNAL_OBJECT_LIST_TO_DETECTION_LIST_COMPONENT_HPP_
16#define CARMA_COOPERATIVE_PERCEPTION__EXTERNAL_OBJECT_LIST_TO_DETECTION_LIST_COMPONENT_HPP_
17
18#include <proj.h>
19
20#include <carma_cooperative_perception_interfaces/msg/detection_list.hpp>
21#include <carma_perception_msgs/msg/external_object_list.hpp>
22#include <carma_ros2_utils/carma_lifecycle_node.hpp>
23#include <rclcpp/rclcpp.hpp>
24#include <std_msgs/msg/string.hpp>
25
26#include <gsl/pointers>
27
28#include <string>
29
31
33{
35 carma_cooperative_perception_interfaces::msg::DetectionList detection_list,
36 const std::string & map_origin) -> carma_cooperative_perception_interfaces::msg::DetectionList;
37
38class ExternalObjectListToDetectionListNode : public carma_ros2_utils::CarmaLifecycleNode
39{
40 using input_msg_type = carma_perception_msgs::msg::ExternalObjectList;
41 using input_msg_shared_pointer = typename input_msg_type::SharedPtr;
42 using output_msg_type = carma_cooperative_perception_interfaces::msg::DetectionList;
43
44public:
45 explicit ExternalObjectListToDetectionListNode(const rclcpp::NodeOptions & options);
46
47 auto handle_on_configure(const rclcpp_lifecycle::State & /* previous_state */)
48 -> carma_ros2_utils::CallbackReturn override;
49
50 auto handle_on_cleanup(const rclcpp_lifecycle::State & /* previous_state */)
51 -> carma_ros2_utils::CallbackReturn override;
52
53 auto handle_on_shutdown(const rclcpp_lifecycle::State & /* previous_state */)
54 -> carma_ros2_utils::CallbackReturn override;
55
56 auto publish_as_detection_list(const input_msg_type & msg) const -> void;
57
58 auto update_georeference(const std_msgs::msg::String & msg) -> void;
59
60private:
61 rclcpp_lifecycle::LifecyclePublisher<output_msg_type>::SharedPtr publisher_{nullptr};
62 rclcpp::Subscription<input_msg_type>::SharedPtr external_objects_subscription_{nullptr};
63 rclcpp::Subscription<std_msgs::msg::String>::SharedPtr georeference_subscription_{nullptr};
64 std::string map_georeference_{""};
66 OnSetParametersCallbackHandle::SharedPtr on_set_parameters_callback_{nullptr};
67};
68
69} // namespace carma_cooperative_perception
70
71#endif // CARMA_COOPERATIVE_PERCEPTION__EXTERNAL_OBJECT_LIST_TO_DETECTION_LIST_COMPONENT_HPP_
auto handle_on_cleanup(const rclcpp_lifecycle::State &) -> carma_ros2_utils::CallbackReturn override
auto handle_on_configure(const rclcpp_lifecycle::State &) -> carma_ros2_utils::CallbackReturn override
auto handle_on_shutdown(const rclcpp_lifecycle::State &) -> carma_ros2_utils::CallbackReturn override
auto transform_from_map_to_utm(carma_cooperative_perception_interfaces::msg::DetectionList detection_list, const std::string &map_origin) -> carma_cooperative_perception_interfaces::msg::DetectionList