mapping_2d/sparse_pose_graph/optimization_problem.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_SPARSE_POSE_GRAPH_OPTIMIZATION_PROBLEM_H_
18 #define CARTOGRAPHER_MAPPING_2D_SPARSE_POSE_GRAPH_OPTIMIZATION_PROBLEM_H_
19 
20 #include <array>
21 #include <deque>
22 #include <map>
23 #include <vector>
24 
25 #include "Eigen/Core"
26 #include "Eigen/Geometry"
30 #include "cartographer/mapping/sparse_pose_graph/proto/optimization_problem_options.pb.h"
32 
33 namespace cartographer {
34 namespace mapping_2d {
35 namespace sparse_pose_graph {
36 
37 struct NodeData {
41 };
42 
43 struct SubmapData {
45 };
46 
47 // Implements the SPA loop closure method.
49  public:
51 
52  explicit OptimizationProblem(
53  const mapping::sparse_pose_graph::proto::OptimizationProblemOptions&
54  options);
56 
58  OptimizationProblem& operator=(const OptimizationProblem&) = delete;
59 
60  void AddImuData(int trajectory_id, common::Time time,
61  const Eigen::Vector3d& linear_acceleration,
62  const Eigen::Vector3d& angular_velocity);
63  void AddTrajectoryNode(int trajectory_id, common::Time time,
66  void AddSubmap(int trajectory_id, const transform::Rigid2d& submap_pose);
67 
68  void SetMaxNumIterations(int32 max_num_iterations);
69 
70  // Computes the optimized poses.
71  void Solve(const std::vector<Constraint>& constraints);
72 
73  const std::vector<std::vector<NodeData>>& node_data() const;
74  const std::vector<std::vector<SubmapData>>& submap_data() const;
75 
76  private:
77  mapping::sparse_pose_graph::proto::OptimizationProblemOptions options_;
78  std::vector<std::deque<mapping_3d::ImuData>> imu_data_;
79  std::vector<std::vector<NodeData>> node_data_;
80  std::vector<std::vector<SubmapData>> submap_data_;
81 };
82 
83 } // namespace sparse_pose_graph
84 } // namespace mapping_2d
85 } // namespace cartographer
86 
87 #endif // CARTOGRAPHER_MAPPING_2D_SPARSE_POSE_GRAPH_OPTIMIZATION_PROBLEM_H_
int32_t int32
Definition: port.h:30
UniversalTimeScaleClock::time_point Time
Definition: time.h:44


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