Apollo 11.0
自动驾驶开放平台
object_builder.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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
17#pragma once
18
19#include <memory>
20#include <string>
21#include <vector>
22
29
30namespace apollo {
31namespace perception {
32namespace radar4d {
33
35
37 public:
42 ObjectBuilder() = default;
43
48 ~ObjectBuilder() = default;
49
57 bool Init(
58 const DetectorInitOptions& options = DetectorInitOptions());
59
68 bool Build(const DetectorOptions& options, RadarFrame* frame);
69
75 std::string Name() const { return "ObjectBuilder"; }
76
77 private:
78 // @brief: calculate 2d polygon.
79 // and fill the convex hull vertices in object->polygon.
80 // @param [in/out]: ObjectPtr.
81 void ComputePolygon2D(
82 std::shared_ptr<apollo::perception::base::Object> object);
83
84 // @brief: calculate the size, center of polygon.
85 // @param [in/out]: ObjectPtr.
86 void ComputePolygonSizeCenter(
87 std::shared_ptr<apollo::perception::base::Object> object);
88
89 // @brief: calculate and fill timestamp and anchor_point.
90 // @param [in/out]: ObjectPtr.
91 void ComputeOtherObjectInformation(
92 std::shared_ptr<apollo::perception::base::Object> object);
93
94 // @brief: calculate and fill default polygon value.
95 // @param [in]: min and max point.
96 // @param [in/out]: ObjectPtr.
97 void SetDefaultValue(
98 const Eigen::Vector3f& min_pt, const Eigen::Vector3f& max_pt,
99 std::shared_ptr<apollo::perception::base::Object> object);
100
101 // @brief: decide whether input cloud is on the same line.
102 // if ture, add perturbation.
103 // @param [in/out]: radarpointcloud.
104 // @param [out]: is line: true, not line: false.
105 bool LinePerturbation(
107 cloud);
108
109 // @brief: calculate 3D min max point
110 // @param [in]: point cloud.
111 // @param [in/out]: min and max points.
112 void GetMinMax3D(const apollo::perception::base::RadarPointCloud<
114 Eigen::Vector3f* min_pt, Eigen::Vector3f* max_pt);
115}; // class ObjectBuilder
116
117} // namespace radar4d
118} // namespace perception
119} // namespace apollo
std::string Name() const
Name of Object Builder
bool Init(const DetectorInitOptions &options=DetectorInitOptions())
Init the Object Builder object with initialization options
bool Build(const DetectorOptions &options, RadarFrame *frame)
Calculate and fill object size, center, directions.
ObjectBuilder()=default
Construct a new Object Builder object
~ObjectBuilder()=default
Destroy the Object Builder object
class register implement
Definition arena_queue.h:37