Apollo  6.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 <limits>
20 #include <memory>
21 #include <vector>
22 
23 namespace apollo {
24 namespace perception {
25 namespace base {
26 
27 template <typename T>
28 struct alignas(16) Point {
29  T x = 0;
30  T y = 0;
31  T z = 0;
32  T intensity = 0;
33  typedef T Type;
34 };
35 
36 template <typename T>
37 struct PointXYZIT : public Point<T> {
38  double timestamp = 0.0;
39 };
40 
41 template <typename T>
42 struct PointXYZITH : public PointXYZIT<T> {
43  float height = std::numeric_limits<float>::max();
44 };
45 
46 template <typename T>
47 struct PointXYZITHB : public PointXYZITH<T> {
48  int32_t beam_id = -1;
49 };
50 
51 template <typename T>
52 struct PointXYZITHBL : public PointXYZITHB<T> {
53  uint8_t label = 0;
54 };
55 
58 
69 
70 const std::size_t kDefaultReservePointNum = 50000;
71 
72 struct PointIndices {
73  PointIndices() { indices.reserve(kDefaultReservePointNum); }
74 
75  std::vector<int> indices;
76 
77  typedef std::shared_ptr<PointIndices> Ptr;
78  typedef std::shared_ptr<const PointIndices> ConstPtr;
79 };
80 
81 template <typename T>
82 struct Point2D {
83  T x = 0;
84  T y = 0;
85 };
86 
90 
91 template <typename T>
92 struct Point3D {
93  T x = 0;
94  T y = 0;
95  T z = 0;
96 };
97 
101 
102 } // namespace base
103 } // namespace perception
104 } // namespace apollo
Definition: point.h:82
std::shared_ptr< const PointIndices > ConstPtr
Definition: point.h:78
std::vector< int > indices
Definition: point.h:75
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: point.h:28
T x
Definition: point.h:29
std::shared_ptr< PointIndices > Ptr
Definition: point.h:77
T z
Definition: point.h:31
const std::size_t kDefaultReservePointNum
Definition: point.h:70
Definition: point.h:92
PointIndices()
Definition: point.h:73
T intensity
Definition: point.h:32
T y
Definition: point.h:30
T Type
Definition: point.h:33