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.
object_detection_tracking_node.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019-2021 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#ifndef EXTERNAL_OBJECT_H
18#define EXTERNAL_OBJECT_H
19
20#include <rclcpp/rclcpp.hpp>
21#include <functional>
22#include <autoware_auto_msgs/msg/tracked_objects.hpp>
23#include <carma_perception_msgs/msg/external_object_list.hpp>
24#include <boost/optional.hpp>
25
27#include "carma_ros2_utils/carma_lifecycle_node.hpp"
28
29namespace object{
30
31class ObjectDetectionTrackingNode : public carma_ros2_utils::CarmaLifecycleNode
32{
33
34 private:
35
36 //subscriber
37 carma_ros2_utils::SubPtr<autoware_auto_msgs::msg::TrackedObjects> autoware_obj_sub_;
38
39 //publisher
40 carma_ros2_utils::PubPtr<carma_perception_msgs::msg::ExternalObjectList> carma_obj_pub_;
41
42 //ObjectDetectionTrackingWorker class object
44
45 // Buffer which holds the tree of transforms
46 tf2_ros::Buffer tfBuffer_;
47
48 // tf2 listeners. Subscribes to the /tf and /tf_static topics
49 tf2_ros::TransformListener tfListener_ {tfBuffer_};
50
51 // Output frame id
52 std::string map_frame_;
53
54 public:
55
59 explicit ObjectDetectionTrackingNode(const rclcpp::NodeOptions& );
60
64 void publishObject(const carma_perception_msgs::msg::ExternalObjectList& obj_msg);
65
74 boost::optional<geometry_msgs::msg::TransformStamped> lookupTransform(const std::string& parent, const std::string& child, const rclcpp::Time& stamp);
75
77 // Overrides
79 carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &);
80
81};
82
83}//object
84
85#endif /* EXTERNAL_OBJECT_H */
carma_ros2_utils::SubPtr< autoware_auto_msgs::msg::TrackedObjects > autoware_obj_sub_
void publishObject(const carma_perception_msgs::msg::ExternalObjectList &obj_msg)
Callback to publish ObjectList.
carma_ros2_utils::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &)
boost::optional< geometry_msgs::msg::TransformStamped > lookupTransform(const std::string &parent, const std::string &child, const rclcpp::Time &stamp)
Callback to lookup a transform between two frames.
ObjectDetectionTrackingNode(const rclcpp::NodeOptions &)
ObjectDetectionTrackingNode constructor.
carma_ros2_utils::PubPtr< carma_perception_msgs::msg::ExternalObjectList > carma_obj_pub_