2d/submaps.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_2D_SUBMAPS_H_
18 #define CARTOGRAPHER_MAPPING_2D_SUBMAPS_H_
19 
20 #include <memory>
21 #include <vector>
22 
23 #include "Eigen/Core"
25 #include "cartographer/mapping/proto/submap_visualization.pb.h"
30 #include "cartographer/mapping_2d/proto/submaps_options.pb.h"
34 
35 namespace cartographer {
36 namespace mapping_2d {
37 
38 ProbabilityGrid ComputeCroppedProbabilityGrid(
39  const ProbabilityGrid& probability_grid);
40 
41 proto::SubmapsOptions CreateSubmapsOptions(
42  common::LuaParameterDictionary* parameter_dictionary);
43 
44 class Submap : public mapping::Submap {
45  public:
46  Submap(const MapLimits& limits, const Eigen::Vector2f& origin);
47 
49 
50  void ToResponseProto(
51  const transform::Rigid3d& global_submap_pose,
52  mapping::proto::SubmapQuery::Response* response) const override;
53 
54  private:
55  // TODO(hrapp): Remove friend declaration.
56  friend class Submaps;
57 
59 };
60 
61 // A container of Submaps.
62 class Submaps : public mapping::Submaps {
63  public:
64  explicit Submaps(const proto::SubmapsOptions& options);
65 
66  Submaps(const Submaps&) = delete;
67  Submaps& operator=(const Submaps&) = delete;
68 
69  const Submap* Get(int index) const override;
70  int size() const override;
71 
72  // Inserts 'range_data' into the Submap collection.
73  void InsertRangeData(const sensor::RangeData& range_data);
74 
75  private:
76  void FinishSubmap(int index);
77  void AddSubmap(const Eigen::Vector2f& origin);
78 
79  const proto::SubmapsOptions options_;
80 
81  std::vector<std::unique_ptr<Submap>> submaps_;
83 };
84 
85 } // namespace mapping_2d
86 } // namespace cartographer
87 
88 #endif // CARTOGRAPHER_MAPPING_2D_SUBMAPS_H_
ProbabilityGrid probability_grid_
Definition: 2d/submaps.h:58
std::vector< std::unique_ptr< Submap > > submaps_
Definition: 2d/submaps.h:81
const ProbabilityGrid & probability_grid() const
Definition: 2d/submaps.h:48
const proto::SubmapsOptions options_
Definition: 2d/submaps.h:79
ProbabilityGrid ComputeCroppedProbabilityGrid(const ProbabilityGrid &probability_grid)
Definition: 2d/submaps.cc:67
void ToResponseProto(const transform::Rigid3d &global_submap_pose, mapping::proto::SubmapQuery::Response *response) const override
Definition: 2d/submaps.cc:108
proto::SubmapsOptions CreateSubmapsOptions(common::LuaParameterDictionary *const parameter_dictionary)
Definition: 2d/submaps.cc:87
Submap(const MapLimits &limits, const Eigen::Vector2f &origin)
Definition: 2d/submaps.cc:103
RangeDataInserter range_data_inserter_
Definition: 2d/submaps.h:82


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