point_cloud.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2016 The Cartographer Authors
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef CARTOGRAPHER_SENSOR_POINT_CLOUD_H_
00018 #define CARTOGRAPHER_SENSOR_POINT_CLOUD_H_
00019 
00020 #include <vector>
00021 
00022 #include "Eigen/Core"
00023 #include "cartographer/sensor/proto/sensor.pb.h"
00024 #include "cartographer/sensor/rangefinder_point.h"
00025 #include "cartographer/transform/rigid_transform.h"
00026 #include "glog/logging.h"
00027 
00028 namespace cartographer {
00029 namespace sensor {
00030 
00031 // Stores 3D positions of points.
00032 // For 2D points, the third entry is 0.f.
00033 using PointCloud = std::vector<RangefinderPoint>;
00034 
00035 // Stores 3D positions of points with their relative measurement time in the
00036 // fourth entry. Time is in seconds, increasing and relative to the moment when
00037 // the last point was acquired. So, the fourth entry for the last point is 0.f.
00038 // If timing is not available, all fourth entries are 0.f. For 2D points, the
00039 // third entry is 0.f (and the fourth entry is time).
00040 using TimedPointCloud = std::vector<TimedRangefinderPoint>;
00041 
00042 struct PointCloudWithIntensities {
00043   TimedPointCloud points;
00044   std::vector<float> intensities;
00045 };
00046 
00047 // Transforms 'point_cloud' according to 'transform'.
00048 PointCloud TransformPointCloud(const PointCloud& point_cloud,
00049                                const transform::Rigid3f& transform);
00050 
00051 // Transforms 'point_cloud' according to 'transform'.
00052 TimedPointCloud TransformTimedPointCloud(const TimedPointCloud& point_cloud,
00053                                          const transform::Rigid3f& transform);
00054 
00055 // Returns a new point cloud without points that fall outside the region defined
00056 // by 'min_z' and 'max_z'.
00057 PointCloud CropPointCloud(const PointCloud& point_cloud, float min_z,
00058                           float max_z);
00059 
00060 // Returns a new point cloud without points that fall outside the region defined
00061 // by 'min_z' and 'max_z'.
00062 TimedPointCloud CropTimedPointCloud(const TimedPointCloud& point_cloud,
00063                                     float min_z, float max_z);
00064 
00065 }  // namespace sensor
00066 }  // namespace cartographer
00067 
00068 #endif  // CARTOGRAPHER_SENSOR_POINT_CLOUD_H_


cartographer
Author(s): The Cartographer Authors
autogenerated on Thu May 9 2019 02:27:35