range_data.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_RANGE_DATA_H_
18 #define CARTOGRAPHER_SENSOR_RANGE_DATA_H_
19 
23 #include "cartographer/sensor/proto/sensor.pb.h"
24 
25 namespace cartographer {
26 namespace sensor {
27 
28 // Rays begin at 'origin'. 'returns' are the points where obstructions were
29 // detected. 'misses' are points in the direction of rays for which no return
30 // was detected, and were inserted at a configured distance. It is assumed that
31 // between the 'origin' and 'misses' is free space.
32 struct RangeData {
33  Eigen::Vector3f origin;
36 };
37 
38 // Converts 'range_data' to a proto::RangeData.
39 proto::RangeData ToProto(const RangeData& range_data);
40 
41 // Converts 'proto' to a RangeData.
42 RangeData FromProto(const proto::RangeData& proto);
43 
44 RangeData TransformRangeData(const RangeData& range_data,
45  const transform::Rigid3f& transform);
46 
47 // Crops 'range_data' according to the region defined by 'min_z' and 'max_z'.
48 RangeData CropRangeData(const RangeData& range_data, float min_z, float max_z);
49 
50 // Like RangeData but with compressed point clouds. The point order changes
51 // when converting from RangeData.
53  Eigen::Vector3f origin;
56 };
57 
58 CompressedRangeData Compress(const RangeData& range_data);
59 
60 RangeData Decompress(const CompressedRangeData& compressed_range_Data);
61 
62 } // namespace sensor
63 } // namespace cartographer
64 
65 #endif // CARTOGRAPHER_SENSOR_RANGE_DATA_H_
int max_z
Definition: 3d/submaps.cc:41
int min_z
Definition: 3d/submaps.cc:40
RangeData TransformRangeData(const RangeData &range_data, const transform::Rigid3f &transform)
Definition: range_data.cc:41
RangeData Decompress(const CompressedRangeData &compressed_range_data)
Definition: range_data.cc:63
proto::PointCloud ToProto(const PointCloud &point_cloud)
Definition: point_cloud.cc:46
std::vector< Eigen::Vector3f > PointCloud
Definition: point_cloud.h:30
CompressedRangeData Compress(const RangeData &range_data)
Definition: range_data.cc:56
RangeData FromProto(const proto::RangeData &proto)
Definition: range_data.cc:33
RangeData CropRangeData(const RangeData &range_data, const float min_z, const float max_z)
Definition: range_data.cc:50


cartographer
Author(s):
autogenerated on Mon Jun 10 2019 12:51:39