Apollo  6.0
Open source self driving car software
point_cloud.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 <utility>
22 #include <vector>
23 
24 #include "Eigen/Dense"
25 
28 
31 
32 namespace apollo {
33 namespace perception {
34 namespace base {
35 
36 template <class PointT>
37 class PointCloud {
38  public:
39  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
40 
41  public:
42  using PointType = PointT;
43  // @brief default constructor
44  PointCloud() = default;
45 
46  // @brief construct from input point cloud and specified indices
47  PointCloud(const PointCloud<PointT>& pc, const PointIndices& indices) {
48  CopyPointCloud(pc, indices);
49  }
50  PointCloud(const PointCloud<PointT>& pc, const std::vector<int>& indices) {
51  CopyPointCloud(pc, indices);
52  }
53  // @brief construct given width and height for organized point cloud
54  PointCloud(size_t width, size_t height, PointT point = PointT())
55  : width_(width), height_(height) {
56  points_.assign(width_ * height_, point);
57  }
58 
59  // @brief destructor
60  virtual ~PointCloud() = default;
61 
62  // @brief accessor of point via 2d indices for organized cloud,
63  // @return nullptr for non-organized cloud
64  inline const PointT* at(size_t col, size_t row) const {
65  return IsOrganized() ? &(points_[row * width_ + col]) : nullptr;
66  }
67  inline PointT* at(size_t col, size_t row) {
68  return IsOrganized() ? &(points_[row * width_ + col]) : nullptr;
69  }
70  inline const PointT* operator()(size_t col, size_t row) const {
71  return IsOrganized() ? &(points_[row * width_ + col]) : nullptr;
72  }
73  inline PointT* operator()(size_t col, size_t row) {
74  return IsOrganized() ? &(points_[row * width_ + col]) : nullptr;
75  }
76  // @brief whether the cloud is organized
77  inline bool IsOrganized() const { return height_ > 1; }
78  // @brief accessor of point cloud height
79  inline size_t height() const { return height_; }
80  // @brief accessor of point cloud width
81  inline size_t width() const { return width_; }
82  // @brief accessor of point size, wrapper of vector
83  inline size_t size() const { return points_.size(); }
84  // @brief reserve function wrapper of vector
85  inline virtual void reserve(size_t size) { points_.reserve(size); }
86  // @brief empty function wrapper of vector
87  inline bool empty() const { return points_.empty(); }
88  // @brief resize function wrapper of vector
89  inline virtual void resize(size_t size) {
90  points_.resize(size);
91  if (size != width_ * height_) {
92  width_ = size;
93  height_ = 1;
94  }
95  }
96  // @brief accessor of point via 1d index
97  inline const PointT& operator[](size_t n) const { return points_[n]; }
98  inline PointT& operator[](size_t n) { return points_[n]; }
99  inline const PointT& at(size_t n) const { return points_[n]; }
100  inline PointT& at(size_t n) { return points_[n]; }
101  // @brief front accessor wrapper of vector
102  inline const PointT& front() const { return points_.front(); }
103  inline PointT& front() { return points_.front(); }
104  // @brief back accessor wrapper of vector
105  inline const PointT& back() const { return points_.back(); }
106  inline PointT& back() { return points_.back(); }
107  // @brief push_back function wrapper of vector
108  inline virtual void push_back(const PointT& point) {
109  points_.push_back(point);
110  width_ = points_.size();
111  height_ = 1;
112  }
113  // @brief clear function wrapper of vector
114  inline virtual void clear() {
115  points_.clear();
116  width_ = height_ = 0;
117  }
118  // @brief swap point given source and target id
119  inline virtual bool SwapPoint(size_t source_id, size_t target_id) {
120  if (source_id < points_.size() && target_id < points_.size()) {
121  std::swap(points_[source_id], points_[target_id]);
122  width_ = points_.size();
123  height_ = 1;
124  return true;
125  }
126  return false;
127  }
128  // @brief copy point from another point cloud
129  inline bool CopyPoint(size_t id, size_t rhs_id,
130  const PointCloud<PointT>& rhs) {
131  if (id < points_.size() && rhs_id < rhs.points_.size()) {
132  points_[id] = rhs.points_[rhs_id];
133  return true;
134  }
135  return false;
136  }
137  // @brief copy point cloud
138  inline void CopyPointCloud(const PointCloud<PointT>& rhs,
139  const PointIndices& indices) {
140  CopyPointCloud(rhs, indices.indices);
141  }
142  template <typename IndexType>
143  inline void CopyPointCloud(const PointCloud<PointT>& rhs,
144  const std::vector<IndexType>& indices) {
145  width_ = indices.size();
146  height_ = 1;
147  points_.resize(indices.size());
148  for (size_t i = 0; i < indices.size(); ++i) {
149  points_[i] = rhs.points_[indices[i]];
150  }
151  }
152  template <typename IndexType>
154  const std::vector<IndexType>& indices) {
155  width_ = indices.size();
156  height_ = 1;
157  points_.resize(rhs.size() - indices.size());
158  std::vector<bool> mask(false, rhs.size());
159  for (size_t i = 0; i < indices.size(); ++i) {
160  mask[indices[i]] = true;
161  }
162  for (size_t i = 0; i < rhs.size(); ++i) {
163  if (!mask[i]) {
164  points_.push_back(rhs.points_[i]);
165  }
166  }
167  }
168 
169  // @brief swap point cloud
170  inline void SwapPointCloud(PointCloud<PointT>* rhs) {
171  points_.swap(rhs->points_);
172  std::swap(width_, rhs->width_);
173  std::swap(height_, rhs->height_);
175  std::swap(timestamp_, rhs->timestamp_);
176  }
177  typedef typename std::vector<PointT>::iterator iterator;
178  typedef typename std::vector<PointT>::const_iterator const_iterator;
179  // @brief vector iterator
180  inline iterator begin() { return points_.begin(); }
181  inline iterator end() { return points_.end(); }
182  inline const_iterator begin() const { return points_.begin(); }
183  inline const_iterator end() const { return points_.end(); }
184  typename std::vector<PointT>* mutable_points() { return &points_; }
185  const typename std::vector<PointT>& points() const { return points_; }
186 
187  // @brief cloud timestamp setter
188  void set_timestamp(const double timestamp) { timestamp_ = timestamp; }
189  // @brief cloud timestamp getter
190  double get_timestamp() { return timestamp_; }
191  // @brief sensor to world pose setter
194  }
195  // @brief sensor to world pose getter
197  return sensor_to_world_pose_;
198  }
199  // @brief rotate the point cloud and set rotation part of pose to identity
200  void RotatePointCloud(bool check_nan = false) {
201  Eigen::Vector3d point3d;
202  Eigen::Matrix3d rotation = sensor_to_world_pose_.linear();
203  for (auto& point : points_) {
204  if (!check_nan || (!std::isnan(point.x) && !std::isnan(point.y) &&
205  !std::isnan(point.z))) {
206  point3d << point.x, point.y, point.z;
207  point3d = rotation * point3d;
208  point.x = static_cast<typename PointT::Type>(point3d(0));
209  point.y = static_cast<typename PointT::Type>(point3d(1));
210  point.z = static_cast<typename PointT::Type>(point3d(2));
211  }
212  }
213  sensor_to_world_pose_.linear().setIdentity();
214  }
215  // @brief transform the point cloud, set the pose to identity
216  void TransformPointCloud(bool check_nan = false) {
217  Eigen::Vector3d point3d;
218  for (auto& point : points_) {
219  if (!check_nan || (!std::isnan(point.x) && !std::isnan(point.y) &&
220  !std::isnan(point.z))) {
221  point3d << point.x, point.y, point.z;
222  point3d = sensor_to_world_pose_ * point3d;
223  point.x = static_cast<typename PointT::Type>(point3d(0));
224  point.y = static_cast<typename PointT::Type>(point3d(1));
225  point.z = static_cast<typename PointT::Type>(point3d(2));
226  }
227  }
228  sensor_to_world_pose_.setIdentity();
229  }
230 
231  // @brief transform the point cloud and save to another pc
232  void TransformPointCloud(const Eigen::Affine3f& transform,
233  PointCloud<PointT>* out,
234  bool check_nan = false) const {
235  Eigen::Vector3f point3f;
236  PointT pt;
237  for (auto& point : points_) {
238  if (!check_nan || (!std::isnan(point.x) && !std::isnan(point.y) &&
239  !std::isnan(point.z))) {
240  point3f << point.x, point.y, point.z;
241  point3f = transform * point3f;
242  pt.x = static_cast<typename PointT::Type>(point3f(0));
243  pt.y = static_cast<typename PointT::Type>(point3f(1));
244  pt.z = static_cast<typename PointT::Type>(point3f(2));
245  out->push_back(pt);
246  }
247  }
248  }
249  // @brief check data member consistency
250  virtual bool CheckConsistency() const { return true; }
251 
252  protected:
253  std::vector<PointT> points_;
254  size_t width_ = 0;
255  size_t height_ = 0;
256 
257  Eigen::Affine3d sensor_to_world_pose_ = Eigen::Affine3d::Identity();
258  double timestamp_ = 0.0;
259 };
260 
261 // @brief Point cloud class split points and attributes storage
262 // for fast traversing
263 template <class PointT>
264 class AttributePointCloud : public PointCloud<PointT> {
265  public:
272  // @brief default constructor
273  AttributePointCloud() = default;
274 
275  // @brief construct from input point cloud and specified indices
277  const PointIndices& indices) {
278  CopyPointCloud(pc, indices);
279  }
281  const std::vector<int>& indices) {
282  CopyPointCloud(pc, indices);
283  }
284  // @brief construct given width and height for organized point cloud
285  AttributePointCloud(const size_t width, const size_t height,
286  const PointT point = PointT()) {
287  width_ = width;
288  height_ = height;
289  size_t size = width_ * height_;
290  points_.assign(size, point);
291  points_timestamp_.assign(size, 0.0);
292  points_height_.assign(size, std::numeric_limits<float>::max());
293  points_beam_id_.assign(size, -1);
294  points_label_.assign(size, 0);
295  }
296  // @brief destructor
297  virtual ~AttributePointCloud() = default;
298  // @brief add points of input cloud, return the self cloud
300  const AttributePointCloud<PointT>& rhs) {
301  points_.insert(points_.end(), rhs.points_.begin(), rhs.points_.end());
302  points_timestamp_.insert(points_timestamp_.end(),
303  rhs.points_timestamp_.begin(),
304  rhs.points_timestamp_.end());
305  points_height_.insert(points_height_.end(), rhs.points_height_.begin(),
306  rhs.points_height_.end());
307  points_beam_id_.insert(points_beam_id_.end(), rhs.points_beam_id_.begin(),
308  rhs.points_beam_id_.end());
309  points_label_.insert(points_label_.end(), rhs.points_label_.begin(),
310  rhs.points_label_.end());
311  width_ = width_ * height_ + rhs.width_ * rhs.height_;
312  height_ = 1;
313  return *this;
314  }
315  // @brief overrided reserve function wrapper of vector
316  inline void reserve(const size_t size) override {
317  points_.reserve(size);
318  points_timestamp_.reserve(size);
319  points_height_.reserve(size);
320  points_beam_id_.reserve(size);
321  points_label_.reserve(size);
322  }
323  // @brief overrided resize function wrapper of vector
324  inline void resize(const size_t size) override {
325  points_.resize(size);
326  points_timestamp_.resize(size, 0.0);
327  points_height_.resize(size, std::numeric_limits<float>::max());
328  points_beam_id_.resize(size, -1);
329  points_label_.resize(size, 0);
330  if (size != width_ * height_) {
331  width_ = size;
332  height_ = 1;
333  }
334  }
335  // @brief overrided push_back function wrapper of vector
336  inline void push_back(const PointT& point) override {
337  points_.push_back(point);
338  points_timestamp_.push_back(0.0);
339  points_height_.push_back(std::numeric_limits<float>::max());
340  points_beam_id_.push_back(-1);
341  points_label_.push_back(0);
342  width_ = points_.size();
343  height_ = 1;
344  }
345  inline void push_back(const PointT& point, double timestamp,
346  float height = std::numeric_limits<float>::max(),
347  int32_t beam_id = -1, uint8_t label = 0) {
348  points_.push_back(point);
349  points_timestamp_.push_back(timestamp);
350  points_height_.push_back(height);
351  points_beam_id_.push_back(beam_id);
352  points_label_.push_back(label);
353  width_ = points_.size();
354  height_ = 1;
355  }
356  // @brief overrided clear function wrapper of vector
357  inline void clear() override {
358  points_.clear();
359  points_timestamp_.clear();
360  points_height_.clear();
361  points_beam_id_.clear();
362  points_label_.clear();
363  width_ = height_ = 0;
364  }
365  // @brief overrided swap point given source and target id
366  inline bool SwapPoint(const size_t source_id,
367  const size_t target_id) override {
368  if (source_id < points_.size() && target_id < points_.size()) {
369  std::swap(points_[source_id], points_[target_id]);
370  std::swap(points_timestamp_[source_id], points_timestamp_[target_id]);
371  std::swap(points_height_[source_id], points_height_[target_id]);
372  std::swap(points_beam_id_[source_id], points_beam_id_[target_id]);
373  std::swap(points_label_[source_id], points_label_[target_id]);
374  width_ = points_.size();
375  height_ = 1;
376  return true;
377  }
378  return false;
379  }
380  // @brief copy point from another point cloud
381  inline bool CopyPoint(const size_t id, const size_t rhs_id,
382  const AttributePointCloud<PointT>& rhs) {
383  if (id < points_.size() && rhs_id < rhs.points_.size()) {
384  points_[id] = rhs.points_[rhs_id];
385  points_timestamp_[id] = rhs.points_timestamp_[rhs_id];
386  points_height_[id] = rhs.points_height_[rhs_id];
387  points_beam_id_[id] = rhs.points_beam_id_[rhs_id];
388  points_label_[id] = rhs.points_label_[rhs_id];
389  return true;
390  }
391  return false;
392  }
393  // @brief copy point cloud
395  const PointIndices& indices) {
396  CopyPointCloud(rhs, indices.indices);
397  }
398  template <typename IndexType>
400  const std::vector<IndexType>& indices) {
401  width_ = indices.size();
402  height_ = 1;
403  points_.resize(indices.size());
404  points_timestamp_.resize(indices.size());
405  points_height_.resize(indices.size());
406  points_beam_id_.resize(indices.size());
407  points_label_.resize(indices.size());
408  for (size_t i = 0; i < indices.size(); ++i) {
409  points_[i] = rhs.points_[indices[i]];
410  points_timestamp_[i] = rhs.points_timestamp_[indices[i]];
411  points_height_[i] = rhs.points_height_[indices[i]];
412  points_beam_id_[i] = rhs.points_beam_id_[indices[i]];
413  points_label_[i] = rhs.points_label_[indices[i]];
414  }
415  }
416 
417  // @brief swap point cloud
419  points_.swap(rhs->points_);
420  std::swap(width_, rhs->width_);
421  std::swap(height_, rhs->height_);
423  std::swap(timestamp_, rhs->timestamp_);
424  points_timestamp_.swap(rhs->points_timestamp_);
425  points_height_.swap(rhs->points_height_);
426  points_beam_id_.swap(rhs->points_beam_id_);
427  points_label_.swap(rhs->points_label_);
428  }
429  // @brief overrided check data member consistency
430  bool CheckConsistency() const override {
431  return ((points_.size() == points_timestamp_.size()) &&
432  (points_.size() == points_height_.size()) &&
433  (points_.size() == points_beam_id_.size()) &&
434  (points_.size() == points_label_.size()));
435  }
436 
437  size_t TransferToIndex(const size_t col, const size_t row) const {
438  return row * width_ + col;
439  }
440 
441  const std::vector<double>& points_timestamp() const {
442  return points_timestamp_;
443  }
444  double points_timestamp(size_t i) const { return points_timestamp_[i]; }
445  std::vector<double>* mutable_points_timestamp() { return &points_timestamp_; }
446 
447  const std::vector<float>& points_height() const { return points_height_; }
448  float& points_height(size_t i) { return points_height_[i]; }
449  const float& points_height(size_t i) const { return points_height_[i]; }
450  void SetPointHeight(size_t i, size_t j, float height) {
451  points_height_[i * width_ + j] = height;
452  }
453  void SetPointHeight(size_t i, float height) { points_height_[i] = height; }
454  std::vector<float>* mutable_points_height() { return &points_height_; }
455 
456  const std::vector<int32_t>& points_beam_id() const { return points_beam_id_; }
457  std::vector<int32_t>* mutable_points_beam_id() { return &points_beam_id_; }
458  int32_t& points_beam_id(size_t i) { return points_beam_id_[i]; }
459  const int32_t& points_beam_id(size_t i) const { return points_beam_id_[i]; }
460 
461  const std::vector<uint8_t>& points_label() const { return points_label_; }
462  std::vector<uint8_t>* mutable_points_label() { return &points_label_; }
463 
464  uint8_t& points_label(size_t i) { return points_label_[i]; }
465  const uint8_t& points_label(size_t i) const { return points_label_[i]; }
466 
467  protected:
468  std::vector<double> points_timestamp_;
469  std::vector<float> points_height_;
470  std::vector<int32_t> points_beam_id_;
471  std::vector<uint8_t> points_label_;
472 };
473 
474 // typedef of point cloud indices
475 typedef std::shared_ptr<PointIndices> PointIndicesPtr;
476 typedef std::shared_ptr<const PointIndices> PointIndicesConstPtr;
477 
478 // typedef of point cloud
481 
482 typedef std::shared_ptr<PointFCloud> PointFCloudPtr;
483 typedef std::shared_ptr<const PointFCloud> PointFCloudConstPtr;
484 
485 typedef std::shared_ptr<PointDCloud> PointDCloudPtr;
486 typedef std::shared_ptr<const PointDCloud> PointDCloudConstPtr;
487 
488 // typedef of polygon
491 
492 typedef std::shared_ptr<PolygonFType> PolygonFTypePtr;
493 typedef std::shared_ptr<const PolygonFType> PolygonFTypeConstPtr;
494 
495 typedef std::shared_ptr<PolygonDType> PolygonDTypePtr;
496 typedef std::shared_ptr<const PolygonDType> PolygonDTypeConstPtr;
497 
498 } // namespace base
499 } // namespace perception
500 } // namespace apollo
void resize(const size_t size) override
Definition: point_cloud.h:324
AttributePointCloud & operator+=(const AttributePointCloud< PointT > &rhs)
Definition: point_cloud.h:299
const std::vector< PointT > & points() const
Definition: point_cloud.h:185
float & points_height(size_t i)
Definition: point_cloud.h:448
std::vector< uint8_t > points_label_
Definition: point_cloud.h:471
const std::vector< double > & points_timestamp() const
Definition: point_cloud.h:441
void push_back(const PointT &point, double timestamp, float height=std::numeric_limits< float >::max(), int32_t beam_id=-1, uint8_t label=0)
Definition: point_cloud.h:345
std::vector< EigenType, Eigen::aligned_allocator< EigenType > > EigenVector
Definition: eigen_defs.h:32
const PointT & back() const
Definition: point_cloud.h:105
bool empty() const
Definition: point_cloud.h:87
PointT & back()
Definition: point_cloud.h:106
double points_timestamp(size_t i) const
Definition: point_cloud.h:444
PointCloud< PointD > PolygonDType
Definition: point_cloud.h:490
std::shared_ptr< PolygonFType > PolygonFTypePtr
Definition: point_cloud.h:492
void SwapPointCloud(PointCloud< PointT > *rhs)
Definition: point_cloud.h:170
Eigen::Vector3f Vector3f
Definition: base_map_fwd.h:29
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
bool IsOrganized() const
Definition: point_cloud.h:77
std::vector< int32_t > * mutable_points_beam_id()
Definition: point_cloud.h:457
std::shared_ptr< PointIndices > PointIndicesPtr
Definition: point_cloud.h:475
Definition: point.h:28
PointCloud< PointF > PolygonFType
Definition: point_cloud.h:489
void clear() override
Definition: point_cloud.h:357
virtual void clear()
Definition: point_cloud.h:114
void CopyPointCloud(const AttributePointCloud< PointT > &rhs, const std::vector< IndexType > &indices)
Definition: point_cloud.h:399
virtual void push_back(const PointT &point)
Definition: point_cloud.h:108
const Eigen::Affine3d & sensor_to_world_pose()
Definition: point_cloud.h:196
AttributePointCloud(const AttributePointCloud< PointT > &pc, const std::vector< int > &indices)
Definition: point_cloud.h:280
AttributePointCloud(const size_t width, const size_t height, const PointT point=PointT())
Definition: point_cloud.h:285
void CopyPointCloud(const AttributePointCloud< PointT > &rhs, const PointIndices &indices)
Definition: point_cloud.h:394
Eigen::Vector3d Vector3d
Definition: frame_transform.h:27
bool CopyPoint(size_t id, size_t rhs_id, const PointCloud< PointT > &rhs)
Definition: point_cloud.h:129
std::map< T, EigenType, std::less< T >, Eigen::aligned_allocator< std::pair< const T, EigenType > >> EigenMap
Definition: eigen_defs.h:36
AttributePointCloud< PointD > PointDCloud
Definition: point_cloud.h:480
const std::vector< int32_t > & points_beam_id() const
Definition: point_cloud.h:456
bool CopyPoint(const size_t id, const size_t rhs_id, const AttributePointCloud< PointT > &rhs)
Definition: point_cloud.h:381
size_t size() const
Definition: point_cloud.h:83
std::vector< float > * mutable_points_height()
Definition: point_cloud.h:454
std::vector< PointT > points_
Definition: point_cloud.h:253
iterator end()
Definition: point_cloud.h:181
Eigen::Affine3f Affine3f
Definition: base_map_fwd.h:28
Definition: point_cloud.h:37
void set_sensor_to_world_pose(const Eigen::Affine3d &sensor_to_world_pose)
Definition: point_cloud.h:192
std::vector< int32_t > points_beam_id_
Definition: point_cloud.h:470
void CopyPointCloud(const PointCloud< PointT > &rhs, const std::vector< IndexType > &indices)
Definition: point_cloud.h:143
void CopyPointCloudExclude(const PointCloud< PointT > &rhs, const std::vector< IndexType > &indices)
Definition: point_cloud.h:153
PointCloud(const PointCloud< PointT > &pc, const PointIndices &indices)
Definition: point_cloud.h:47
std::vector< uint8_t > * mutable_points_label()
Definition: point_cloud.h:462
void SetPointHeight(size_t i, size_t j, float height)
Definition: point_cloud.h:450
void TransformPointCloud(bool check_nan=false)
Definition: point_cloud.h:216
AttributePointCloud(const AttributePointCloud< PointT > &pc, const PointIndices &indices)
Definition: point_cloud.h:276
size_t height_
Definition: point_cloud.h:255
std::shared_ptr< const PointFCloud > PointFCloudConstPtr
Definition: point_cloud.h:483
PointT * operator()(size_t col, size_t row)
Definition: point_cloud.h:73
PointCloud(size_t width, size_t height, PointT point=PointT())
Definition: point_cloud.h:54
std::vector< PointT > * mutable_points()
Definition: point_cloud.h:184
uint8_t & points_label(size_t i)
Definition: point_cloud.h:464
const PointT & operator[](size_t n) const
Definition: point_cloud.h:97
PointCloud(const PointCloud< PointT > &pc, const std::vector< int > &indices)
Definition: point_cloud.h:50
PointT & front()
Definition: point_cloud.h:103
size_t TransferToIndex(const size_t col, const size_t row) const
Definition: point_cloud.h:437
void SetPointHeight(size_t i, float height)
Definition: point_cloud.h:453
size_t height() const
Definition: point_cloud.h:79
std::shared_ptr< const PointDCloud > PointDCloudConstPtr
Definition: point_cloud.h:486
bool CheckConsistency() const override
Definition: point_cloud.h:430
std::vector< double > * mutable_points_timestamp()
Definition: point_cloud.h:445
double timestamp_
Definition: point_cloud.h:258
void CopyPointCloud(const PointCloud< PointT > &rhs, const PointIndices &indices)
Definition: point_cloud.h:138
size_t width() const
Definition: point_cloud.h:81
PointT & at(size_t n)
Definition: point_cloud.h:100
virtual void resize(size_t size)
Definition: point_cloud.h:89
PointT & operator[](size_t n)
Definition: point_cloud.h:98
const_iterator end() const
Definition: point_cloud.h:183
bool SwapPoint(const size_t source_id, const size_t target_id) override
Definition: point_cloud.h:366
std::shared_ptr< const PointIndices > PointIndicesConstPtr
Definition: point_cloud.h:476
std::shared_ptr< PointFCloud > PointFCloudPtr
Definition: point_cloud.h:482
const uint8_t & points_label(size_t i) const
Definition: point_cloud.h:465
double get_timestamp()
Definition: point_cloud.h:190
Eigen::Affine3d sensor_to_world_pose_
Definition: point_cloud.h:257
std::vector< PointT >::iterator iterator
Definition: point_cloud.h:177
const PointT & at(size_t n) const
Definition: point_cloud.h:99
void RotatePointCloud(bool check_nan=false)
Definition: point_cloud.h:200
std::shared_ptr< const PolygonFType > PolygonFTypeConstPtr
Definition: point_cloud.h:493
const_iterator begin() const
Definition: point_cloud.h:182
const std::vector< uint8_t > & points_label() const
Definition: point_cloud.h:461
const float & points_height(size_t i) const
Definition: point_cloud.h:449
void reserve(const size_t size) override
Definition: point_cloud.h:316
void set_timestamp(const double timestamp)
Definition: point_cloud.h:188
const PointT & front() const
Definition: point_cloud.h:102
const PointT * operator()(size_t col, size_t row) const
Definition: point_cloud.h:70
Eigen::Affine3d Affine3d
Definition: base_map_fwd.h:34
size_t width_
Definition: point_cloud.h:254
iterator begin()
Definition: point_cloud.h:180
void SwapPointCloud(AttributePointCloud< PointT > *rhs)
Definition: point_cloud.h:418
virtual bool SwapPoint(size_t source_id, size_t target_id)
Definition: point_cloud.h:119
Eigen::Matrix3d Matrix3d
Definition: base_map_fwd.h:33
const int32_t & points_beam_id(size_t i) const
Definition: point_cloud.h:459
std::vector< float > points_height_
Definition: point_cloud.h:469
virtual void reserve(size_t size)
Definition: point_cloud.h:85
virtual bool CheckConsistency() const
Definition: point_cloud.h:250
std::vector< PointT >::const_iterator const_iterator
Definition: point_cloud.h:178
std::shared_ptr< PointDCloud > PointDCloudPtr
Definition: point_cloud.h:485
std::shared_ptr< PolygonDType > PolygonDTypePtr
Definition: point_cloud.h:495
int32_t & points_beam_id(size_t i)
Definition: point_cloud.h:458
void TransformPointCloud(const Eigen::Affine3f &transform, PointCloud< PointT > *out, bool check_nan=false) const
Definition: point_cloud.h:232
std::shared_ptr< const PolygonDType > PolygonDTypeConstPtr
Definition: point_cloud.h:496
void push_back(const PointT &point) override
Definition: point_cloud.h:336
std::vector< double > points_timestamp_
Definition: point_cloud.h:468
const PointT * at(size_t col, size_t row) const
Definition: point_cloud.h:64
const std::vector< float > & points_height() const
Definition: point_cloud.h:447
AttributePointCloud< PointF > PointFCloud
Definition: point_cloud.h:479
PointT * at(size_t col, size_t row)
Definition: point_cloud.h:67