point_cloud.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
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 #ifndef CARTOGRAPHER_SENSOR_POINT_CLOUD_H_
18 #define CARTOGRAPHER_SENSOR_POINT_CLOUD_H_
19 
20 #include <vector>
21 
22 #include "Eigen/Core"
23 #include "cartographer/sensor/proto/sensor.pb.h"
25 #include "glog/logging.h"
26 
27 namespace cartographer {
28 namespace sensor {
29 
30 // Stores 3D positions of points.
31 // For 2D points, the third entry is 0.f.
32 typedef std::vector<Eigen::Vector3f> PointCloud;
33 
34 // Stores 3D positions of points with their relative measurement time in the
35 // fourth entry. Time is in seconds, increasing and relative to the moment when
36 // the last point was acquired. So, the fourth entry for the last point is 0.f.
37 // If timing is not available, all fourth entries are 0.f. For 2D points, the
38 // third entry is 0.f (and the fourth entry is time).
39 typedef std::vector<Eigen::Vector4f> TimedPointCloud;
40 
42  TimedPointCloud points;
43  std::vector<float> intensities;
44 };
45 
46 // Transforms 'point_cloud' according to 'transform'.
47 PointCloud TransformPointCloud(const PointCloud& point_cloud,
48  const transform::Rigid3f& transform);
49 
50 // Transforms 'point_cloud' according to 'transform'.
51 TimedPointCloud TransformTimedPointCloud(const TimedPointCloud& point_cloud,
52  const transform::Rigid3f& transform);
53 
54 // Returns a new point cloud without points that fall outside the region defined
55 // by 'min_z' and 'max_z'.
56 PointCloud CropPointCloud(const PointCloud& point_cloud, float min_z,
57  float max_z);
58 
59 // Returns a new point cloud without points that fall outside the region defined
60 // by 'min_z' and 'max_z'.
61 TimedPointCloud CropTimedPointCloud(const TimedPointCloud& point_cloud,
62  float min_z, float max_z);
63 
64 } // namespace sensor
65 } // namespace cartographer
66 
67 #endif // CARTOGRAPHER_SENSOR_POINT_CLOUD_H_
PointCloud TransformPointCloud(const PointCloud &point_cloud, const transform::Rigid3f &transform)
Definition: point_cloud.cc:25
TimedPointCloud TransformTimedPointCloud(const TimedPointCloud &point_cloud, const transform::Rigid3f &transform)
Definition: point_cloud.cc:35
PointCloud CropPointCloud(const PointCloud &point_cloud, const float min_z, const float max_z)
Definition: point_cloud.cc:48
std::vector< Eigen::Vector3f > PointCloud
Definition: point_cloud.h:32
std::vector< Eigen::Vector4f > TimedPointCloud
Definition: point_cloud.h:39
int min_z
Definition: submap_3d.cc:31
int max_z
Definition: submap_3d.cc:32
TimedPointCloud CropTimedPointCloud(const TimedPointCloud &point_cloud, const float min_z, const float max_z)
Definition: point_cloud.cc:59


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:58