Apollo  v5.5.0
Open source self driving car software
point.h
Go to the documentation of this file.
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 
17 #pragma once
18 
19 #include <cfloat>
20 #include <limits>
21 #include <memory>
22 #include <vector>
23 
24 namespace apollo {
25 namespace perception {
26 namespace base {
27 
28 template <typename T>
29 struct Point {
30  T x = 0;
31  T y = 0;
32  T z = 0;
33  T intensity = 0;
34  typedef T Type;
35 };
36 
37 template <typename T>
38 struct PointXYZIT : public Point<T> {
39  double timestamp = 0.0;
40 };
41 
42 template <typename T>
43 struct PointXYZITH : public PointXYZIT<T> {
44  float height = std::numeric_limits<float>::max();
45 };
46 
47 template <typename T>
48 struct PointXYZITHB : public PointXYZITH<T> {
49  int32_t beam_id = -1;
50 };
51 
52 template <typename T>
53 struct PointXYZITHBL : public PointXYZITHB<T> {
54  uint8_t label = 0;
55 };
56 
59 
70 
71 const std::size_t kDefaultReservePointNum = 50000;
72 
73 struct PointIndices {
74  PointIndices() { indices.reserve(kDefaultReservePointNum); }
75 
76  std::vector<int> indices;
77 
78  typedef std::shared_ptr<PointIndices> Ptr;
79  typedef std::shared_ptr<const PointIndices> ConstPtr;
80 };
81 
82 template <typename T>
83 struct Point2D {
84  T x = 0;
85  T y = 0;
86 };
87 
91 
92 template <typename T>
93 struct Point3D {
94  T x = 0;
95  T y = 0;
96  T z = 0;
97 };
98 
102 
103 } // namespace base
104 } // namespace perception
105 } // namespace apollo
Definition: point.h:83
std::shared_ptr< const PointIndices > ConstPtr
Definition: point.h:79
std::vector< int > indices
Definition: point.h:76
Definition: blob.h:72
Definition: point.h:29
T x
Definition: point.h:30
std::shared_ptr< PointIndices > Ptr
Definition: point.h:78
T z
Definition: point.h:32
const std::size_t kDefaultReservePointNum
Definition: point.h:71
Definition: point.h:93
PointIndices()
Definition: point.h:74
T intensity
Definition: point.h:33
T y
Definition: point.h:31
T Type
Definition: point.h:34