overlapping_submaps_trimmer_2d.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 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_INTERNAL_2D_OVERLAPPING_SUBMAPS_TRIMMER_H_
18 #define CARTOGRAPHER_MAPPING_INTERNAL_2D_OVERLAPPING_SUBMAPS_TRIMMER_H_
19 
22 
23 namespace cartographer {
24 namespace mapping {
25 
26 // Trims submaps that have less than 'min_covered_cells_count' cells not
27 // overlapped by at least 'fresh_submaps_count` submaps.
29  public:
30  OverlappingSubmapsTrimmer2D(uint16 fresh_submaps_count,
31  uint16 min_covered_cells_count,
32  uint16 min_added_submaps_count)
33  : fresh_submaps_count_(fresh_submaps_count),
34  min_covered_cells_count_(min_covered_cells_count),
35  min_added_submaps_count_(min_added_submaps_count) {}
36  ~OverlappingSubmapsTrimmer2D() override = default;
37 
38  void Trim(Trimmable* pose_graph) override;
39  bool IsFinished() override { return finished_; }
40 
41  private:
42  // Number of the most recent submaps to keep.
44  // Minimal number of covered cells to keep submap from trimming.
46  // Number of added submaps before the trimmer is invoked.
48  // Current finished submap count.
50 
51  bool finished_ = false;
52 };
53 
54 } // namespace mapping
55 } // namespace cartographer
56 
57 #endif // CARTOGRAPHER_MAPPING_INTERNAL_2D_OVERLAPPING_SUBMAPS_TRIMMER_H_
uint16_t uint16
Definition: port.h:35
OverlappingSubmapsTrimmer2D(uint16 fresh_submaps_count, uint16 min_covered_cells_count, uint16 min_added_submaps_count)


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