precomputation_grid.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_MAPPING_3D_SCAN_MATCHING_PRECOMPUTATION_GRID_H_
18 #define CARTOGRAPHER_MAPPING_3D_SCAN_MATCHING_PRECOMPUTATION_GRID_H_
19 
21 
22 namespace cartographer {
23 namespace mapping_3d {
24 namespace scan_matching {
25 
26 class PrecomputationGrid : public HybridGridBase<uint8> {
27  public:
28  explicit PrecomputationGrid(const float resolution)
29  : HybridGridBase<uint8>(resolution) {}
30 
31  // Maps values from [0, 255] to [kMinProbability, kMaxProbability].
32  static float ToProbability(float value) {
34  value *
36  }
37 };
38 
39 // Converts a HybridGrid to a PrecomputationGrid representing the same data,
40 // but only using 8 bit instead of 2 x 16 bit.
42 
43 // Returns a grid of the same resolution containing the maximum value of
44 // original voxels in 'grid'. This maximum is over the 8 voxels that have
45 // any combination of index components optionally increased by 'shift'.
46 // If 'shift' is 2 ** (depth - 1), where depth 0 is the original grid, and this
47 // is using the precomputed grid of one depth before, this results in
48 // precomputation grids analogous to the 2D case.
50  bool half_resolution,
51  const Eigen::Array3i& shift);
52 
53 } // namespace scan_matching
54 } // namespace mapping_3d
55 } // namespace cartographer
56 
57 #endif // CARTOGRAPHER_MAPPING_3D_SCAN_MATCHING_PRECOMPUTATION_GRID_H_
constexpr float kMinProbability
uint8_t uint8
Definition: port.h:32
constexpr float kMaxProbability
PrecomputationGrid PrecomputeGrid(const PrecomputationGrid &grid, const bool half_resolution, const Eigen::Array3i &shift)
ValueType value(const Eigen::Array3i &index) const
Definition: hybrid_grid.h:263
PrecomputationGrid ConvertToPrecomputationGrid(const HybridGrid &hybrid_grid)


cartographer
Author(s):
autogenerated on Wed Jun 5 2019 21:57:58