Apollo 11.0
自动驾驶开放平台
bg_object_builder.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2024 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
18
22
23namespace apollo {
24namespace perception {
25namespace lidar {
26
27bool BgObjectBuilder(std::vector<base::ObjectPtr>* objects, Eigen::Affine3d& lidar2novatel_pose) {
28 if (objects == nullptr) {
29 AINFO << "objects is null.";
30 return false;
31 }
32 ObjectBuilder object_builder;
33 object_builder.Init();
34 for (size_t i = 0; i < objects->size(); i++) {
35 if (objects->at(i)) {
36 object_builder.ComputePolygon2D(objects->at(i));
37 ComputePolygonDirection(Eigen::Vector3d(0, 0, 0), objects->at(i), &objects->at(i)->direction);
38 object_builder.ComputePolygonSizeCenter(objects->at(i));
39 object_builder.ComputeOtherObjectInformation(objects->at(i));
40 object_builder.ComputeHeightAboveGround(objects->at(i));
41 if (FLAGS_need_judge_front_critical) {
42 objects->at(i)->lidar_supplement.is_clustered = true;
43 object_builder.JudgeFrontCritical(objects->at(i), lidar2novatel_pose);
44 }
45 }
46 }
47 return true;
48}
49
50} // namespace lidar
51} // namespace perception
52} // namespace apollo
void ComputeHeightAboveGround(std::shared_ptr< apollo::perception::base::Object > object)
void ComputeOtherObjectInformation(std::shared_ptr< apollo::perception::base::Object > object)
void ComputePolygon2D(std::shared_ptr< apollo::perception::base::Object > object)
bool Init(const ObjectBuilderInitOptions &options=ObjectBuilderInitOptions())
Init the Object Builder object with initialization options
void JudgeFrontCritical(std::shared_ptr< apollo::perception::base::Object > object, Eigen::Affine3d &lidar2novatel_pose)
void ComputePolygonSizeCenter(std::shared_ptr< apollo::perception::base::Object > object)
#define AINFO
Definition log.h:42
bool BgObjectBuilder(std::vector< base::ObjectPtr > *objects, Eigen::Affine3d &lidar2novatel_pose)
background objects builder
void ComputePolygonDirection(const Eigen::Vector3d &ref_center, const base::ObjectPtr &object, Eigen::Vector3f *direction)
Compute polygon direction
class register implement
Definition arena_queue.h:37