Apollo 11.0
自动驾驶开放平台
lidar_frame.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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 <memory>
19#include <string>
20#include <vector>
21
22#include "Eigen/Dense"
23
28
29namespace apollo {
30namespace perception {
31namespace lidar {
32
33struct LidarFrame {
34 // point cloud
35 std::shared_ptr<base::AttributePointCloud<base::PointF>> cloud;
36 // world point cloud
37 std::shared_ptr<base::AttributePointCloud<base::PointD>> world_cloud;
38 // timestamp
39 double timestamp = 0.0;
40 // parsing ground height
41 float parsing_ground_height = 10.0f;
42 // lidar-origin ground z-value
43 float original_ground_z = 10.0f;
44 // lidar to world pose
45 Eigen::Affine3d lidar2world_pose = Eigen::Affine3d::Identity();
46 // lidar to world pose
47 Eigen::Affine3d novatel2world_pose = Eigen::Affine3d::Identity();
48 // lidar to
49 Eigen::Affine3d lidar2novatel_extrinsics = Eigen::Affine3d::Identity();
50 // hdmap struct
51 std::shared_ptr<base::HdmapStruct> hdmap_struct = nullptr;
52 // segmented objects
53 std::vector<std::shared_ptr<base::Object>> segmented_objects;
54 // tracked objects
55 std::vector<std::shared_ptr<base::Object>> tracked_objects;
56 // point cloud roi indices
58 // point cloud non ground indices
60 // secondary segmentor indices
62 // sensor info
64 // reserve string
65 std::string reserve;
66
67 void Reset() {
68 if (cloud) {
69 cloud->clear();
70 }
71 if (world_cloud) {
72 world_cloud->clear();
73 }
74 timestamp = 0.0;
76 original_ground_z = 10.0f;
77 lidar2world_pose = Eigen::Affine3d::Identity();
78 novatel2world_pose = Eigen::Affine3d::Identity();
79 if (hdmap_struct) {
80 hdmap_struct->road_boundary.clear();
81 hdmap_struct->road_polygons.clear();
82 hdmap_struct->junction_polygons.clear();
83 hdmap_struct->hole_polygons.clear();
84 }
85 segmented_objects.clear();
86 tracked_objects.clear();
87 roi_indices.indices.clear();
90 }
91
93 const std::vector<uint32_t> &indices) {
94 if (cloud && filtered_cloud) {
95 filtered_cloud->CopyPointCloudExclude(*cloud, indices);
96 }
97 }
98
99 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
100}; // struct LidarFrame
101
102} // namespace lidar
103} // namespace perception
104} // namespace apollo
void CopyPointCloudExclude(const PointCloud< PointT > &rhs, const std::vector< IndexType > &indices)
class register implement
Definition arena_queue.h:37
std::shared_ptr< base::AttributePointCloud< base::PointD > > world_cloud
Definition lidar_frame.h:37
std::shared_ptr< base::HdmapStruct > hdmap_struct
Definition lidar_frame.h:51
std::vector< std::shared_ptr< base::Object > > segmented_objects
Definition lidar_frame.h:53
void FilterPointCloud(base::PointCloud< base::PointF > *filtered_cloud, const std::vector< uint32_t > &indices)
Definition lidar_frame.h:92
std::shared_ptr< base::AttributePointCloud< base::PointF > > cloud
Definition lidar_frame.h:35
std::vector< std::shared_ptr< base::Object > > tracked_objects
Definition lidar_frame.h:55