sparse_pose_graph.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_SPARSE_POSE_GRAPH_H_
18 #define CARTOGRAPHER_MAPPING_SPARSE_POSE_GRAPH_H_
19 
20 #include <memory>
21 #include <set>
22 #include <unordered_map>
23 #include <utility>
24 #include <vector>
25 
29 #include "cartographer/mapping/proto/sparse_pose_graph.pb.h"
30 #include "cartographer/mapping/proto/sparse_pose_graph_options.pb.h"
33 
34 namespace cartographer {
35 namespace mapping {
36 
37 proto::SparsePoseGraphOptions CreateSparsePoseGraphOptions(
38  common::LuaParameterDictionary* const parameter_dictionary);
39 
41  public:
42  // A "constraint" as in the paper by Konolige, Kurt, et al. "Efficient sparse
43  // pose adjustment for 2d mapping." Intelligent Robots and Systems (IROS),
44  // 2010 IEEE/RSJ International Conference on (pp. 22--29). IEEE, 2010.
45  struct Constraint {
46  struct Pose {
50  };
51 
52  SubmapId submap_id; // 'i' in the paper.
53  NodeId node_id; // 'j' in the paper.
54 
55  // Pose of the scan 'j' relative to submap 'i'.
57 
58  // Differentiates between intra-submap (where scan 'j' was inserted into
59  // submap 'i') and inter-submap constraints (where scan 'j' was not inserted
60  // into submap 'i').
62  };
63 
65  virtual ~SparsePoseGraph() {}
66 
67  SparsePoseGraph(const SparsePoseGraph&) = delete;
68  SparsePoseGraph& operator=(const SparsePoseGraph&) = delete;
69 
70  // Adds a 'trimmer'. It will be used after all data added before it has been
71  // included in the pose graph.
72  virtual void AddTrimmer(std::unique_ptr<PoseGraphTrimmer> trimmer) = 0;
73 
74  // Computes optimized poses.
75  virtual void RunFinalOptimization() = 0;
76 
77  // Gets the current trajectory clusters.
78  virtual std::vector<std::vector<int>> GetConnectedTrajectories() = 0;
79 
80  // Return the number of submaps for the given 'trajectory_id'.
81  virtual int num_submaps(int trajectory_id) = 0;
82 
83  // Returns the current optimized transform for the given 'submap_id'.
85 
86  // Returns the transform converting data in the local map frame (i.e. the
87  // continuous, non-loop-closed frame) into the global map frame (i.e. the
88  // discontinuous, loop-closed frame).
89  virtual transform::Rigid3d GetLocalToGlobalTransform(int trajectory_id) = 0;
90 
91  // Returns the current optimized trajectories.
92  virtual std::vector<std::vector<TrajectoryNode>> GetTrajectoryNodes() = 0;
93 
94  // Serializes the constraints and trajectories.
95  proto::SparsePoseGraph ToProto();
96 
97  // Returns the collection of constraints.
98  virtual std::vector<Constraint> constraints() = 0;
99 };
100 
101 } // namespace mapping
102 } // namespace cartographer
103 
104 #endif // CARTOGRAPHER_MAPPING_SPARSE_POSE_GRAPH_H_
virtual transform::Rigid3d GetSubmapTransform(const SubmapId &submap_id)=0
virtual std::vector< std::vector< TrajectoryNode > > GetTrajectoryNodes()=0
virtual void AddTrimmer(std::unique_ptr< PoseGraphTrimmer > trimmer)=0
SparsePoseGraph & operator=(const SparsePoseGraph &)=delete
virtual std::vector< Constraint > constraints()=0
enum cartographer::mapping::SparsePoseGraph::Constraint::Tag tag
virtual int num_submaps(int trajectory_id)=0
virtual std::vector< std::vector< int > > GetConnectedTrajectories()=0
virtual transform::Rigid3d GetLocalToGlobalTransform(int trajectory_id)=0
proto::SparsePoseGraphOptions CreateSparsePoseGraphOptions(common::LuaParameterDictionary *const parameter_dictionary)


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