Apollo 11.0
自动驾驶开放平台
mask_pillars_detection.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2021 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of 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,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16#pragma once
17
18#include <deque>
19#include <memory>
20#include <string>
21#include <vector>
22
23#include "pcl/point_cloud.h"
24#include "pcl/point_types.h"
25
32#include "modules/perception/lidar_detection/detector/mask_pillars_detection/proto/model_param.pb.h"
33
34namespace apollo {
35namespace perception {
36namespace lidar {
37
39 public:
45
50 virtual ~MaskPillarsDetection() = default;
51
59 bool Init(const LidarDetectorInitOptions& options =
60 LidarDetectorInitOptions()) override;
61
70 bool Detect(const LidarDetectorOptions& options, LidarFrame* frame) override;
71
77 std::string Name() const override { return "MaskPillarsDetection"; }
78
79 private:
80 void CloudToArray(const base::PointFCloudPtr& pc_ptr, float* out_points_array,
81 float normalizing_factor);
82
83 void FuseCloud(const base::PointFCloudPtr& out_cloud_ptr,
84 const std::deque<base::PointDCloudPtr>& fuse_clouds);
85
86 std::vector<int> GenerateIndices(int start_index, int size, bool shuffle);
87
88 void GetObjects(std::vector<std::shared_ptr<base::Object>>* objects,
89 const Eigen::Affine3d& pose, std::vector<float>* detections,
90 std::vector<int>* labels);
91
92 base::ObjectSubType GetObjectSubType(int label);
93
94 // reference pointer of lidar frame
95 LidarFrame* lidar_frame_ref_ = nullptr;
96 std::shared_ptr<base::AttributePointCloud<base::PointF>> original_cloud_;
97 std::shared_ptr<base::AttributePointCloud<base::PointD>>
98 original_world_cloud_;
99
100 // PointPillars
101 std::unique_ptr<PointPillars> point_pillars_ptr_;
102 std::deque<base::PointDCloudPtr> prev_world_clouds_;
103 base::PointFCloudPtr cur_cloud_ptr_;
104
105 // MaskPillars params
107
108 std::shared_ptr<BaseDownSample> down_sample_;
109
110 // point cloud range
111 float x_min_;
112 float x_max_;
113 float y_min_;
114 float y_max_;
115 float z_min_;
116 float z_max_;
117
118 // time statistics
119 double downsample_time_ = 0.0;
120 double fuse_time_ = 0.0;
121 double shuffle_time_ = 0.0;
122 double cloud_to_array_time_ = 0.0;
123 double inference_time_ = 0.0;
124 double collect_time_ = 0.0;
125}; // class MaskPillarsDetection
126
127} // namespace lidar
128} // namespace perception
129} // namespace apollo
MaskPillarsDetection()
Construct a new Mask Pillars Detection object
bool Init(const LidarDetectorInitOptions &options=LidarDetectorInitOptions()) override
Init of Mask Pillars Detection object
virtual ~MaskPillarsDetection()=default
Destroy the Mask Pillars Detection object
std::string Name() const override
Name of Mask Pillars Detection module
bool Detect(const LidarDetectorOptions &options, LidarFrame *frame) override
Detect foregorund objects using maskpillars
Algorithm for PointPillars
std::shared_ptr< PointFCloud > PointFCloudPtr
class register implement
Definition arena_queue.h:37