|
| 1 | +// Copyright 2020 Tier IV, Inc. |
| 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 OBJECT_ASSOCIATION_MERGER__NODE_HPP_ |
| 16 | +#define OBJECT_ASSOCIATION_MERGER__NODE_HPP_ |
| 17 | + |
| 18 | +#include <object_association_merger/data_association.hpp> |
| 19 | +#include <rclcpp/rclcpp.hpp> |
| 20 | + |
| 21 | +#include <autoware_auto_perception_msgs/msg/detected_objects.hpp> |
| 22 | + |
| 23 | +#include <message_filters/subscriber.h> |
| 24 | +#include <message_filters/sync_policies/approximate_time.h> |
| 25 | +#include <message_filters/synchronizer.h> |
| 26 | +#include <pcl_conversions/pcl_conversions.h> |
| 27 | +#include <tf2_ros/buffer.h> |
| 28 | +#include <tf2_ros/transform_listener.h> |
| 29 | + |
| 30 | +#include <memory> |
| 31 | + |
| 32 | +namespace object_association |
| 33 | +{ |
| 34 | +class ObjectAssociationMergerNode : public rclcpp::Node |
| 35 | +{ |
| 36 | +public: |
| 37 | + explicit ObjectAssociationMergerNode(const rclcpp::NodeOptions & node_options); |
| 38 | + |
| 39 | +private: |
| 40 | + void objectsCallback( |
| 41 | + const autoware_auto_perception_msgs::msg::DetectedObjects::ConstSharedPtr & input_object0_msg, |
| 42 | + const autoware_auto_perception_msgs::msg::DetectedObjects::ConstSharedPtr & input_object1_msg); |
| 43 | + |
| 44 | + tf2_ros::Buffer tf_buffer_; |
| 45 | + tf2_ros::TransformListener tf_listener_; |
| 46 | + rclcpp::Publisher<autoware_auto_perception_msgs::msg::DetectedObjects>::SharedPtr |
| 47 | + merged_object_pub_; |
| 48 | + message_filters::Subscriber<autoware_auto_perception_msgs::msg::DetectedObjects> object0_sub_; |
| 49 | + message_filters::Subscriber<autoware_auto_perception_msgs::msg::DetectedObjects> object1_sub_; |
| 50 | + typedef message_filters::sync_policies::ApproximateTime< |
| 51 | + autoware_auto_perception_msgs::msg::DetectedObjects, |
| 52 | + autoware_auto_perception_msgs::msg::DetectedObjects> |
| 53 | + SyncPolicy; |
| 54 | + typedef message_filters::Synchronizer<SyncPolicy> Sync; |
| 55 | + Sync sync_; |
| 56 | + DataAssociation data_association_; |
| 57 | +}; |
| 58 | +} // namespace object_association |
| 59 | + |
| 60 | +#endif // OBJECT_ASSOCIATION_MERGER__NODE_HPP_ |
0 commit comments