-
Notifications
You must be signed in to change notification settings - Fork 691
/
Copy pathvoxel_grid_based_euclidean_cluster_node.hpp
48 lines (38 loc) · 1.8 KB
/
voxel_grid_based_euclidean_cluster_node.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2020 Tier IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include "autoware/euclidean_cluster/voxel_grid_based_euclidean_cluster.hpp"
#include <autoware/universe_utils/ros/debug_publisher.hpp>
#include <autoware/universe_utils/system/stop_watch.hpp>
#include <rclcpp/rclcpp.hpp>
#include <geometry_msgs/msg/pose_stamped.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <tier4_perception_msgs/msg/detected_objects_with_feature.hpp>
#include <memory>
namespace autoware::euclidean_cluster
{
class VoxelGridBasedEuclideanClusterNode : public rclcpp::Node
{
public:
explicit VoxelGridBasedEuclideanClusterNode(const rclcpp::NodeOptions & options);
private:
void onPointCloud(const sensor_msgs::msg::PointCloud2::ConstSharedPtr input_msg);
rclcpp::Subscription<sensor_msgs::msg::PointCloud2>::SharedPtr pointcloud_sub_;
rclcpp::Publisher<tier4_perception_msgs::msg::DetectedObjectsWithFeature>::SharedPtr cluster_pub_;
rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr debug_pub_;
std::shared_ptr<VoxelGridBasedEuclideanCluster> cluster_;
std::unique_ptr<autoware::universe_utils::StopWatch<std::chrono::milliseconds>> stop_watch_ptr_;
std::unique_ptr<autoware::universe_utils::DebugPublisher> debug_publisher_;
};
} // namespace autoware::euclidean_cluster