pose_graph_data.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2018 The Cartographer Authors
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef CARTOGRAPHER_MAPPING_POSE_GRAPH_DATA_H_
00018 #define CARTOGRAPHER_MAPPING_POSE_GRAPH_DATA_H_
00019 
00020 #include <map>
00021 #include <set>
00022 #include <vector>
00023 
00024 #include "cartographer/mapping/internal/optimization/optimization_problem_2d.h"
00025 #include "cartographer/mapping/internal/optimization/optimization_problem_3d.h"
00026 #include "cartographer/mapping/internal/trajectory_connectivity_state.h"
00027 #include "cartographer/mapping/pose_graph.h"
00028 #include "cartographer/mapping/pose_graph_interface.h"
00029 #include "cartographer/mapping/submaps.h"
00030 
00031 namespace cartographer {
00032 namespace mapping {
00033 
00034 // The current state of the submap in the background threads. After this
00035 // transitions to 'kFinished', all nodes are tried to match
00036 // against this submap. Likewise, all new nodes are matched against submaps in
00037 // that state.
00038 enum class SubmapState { kNoConstraintSearch, kFinished };
00039 
00040 struct InternalTrajectoryState {
00041   enum class DeletionState {
00042     NORMAL,
00043     SCHEDULED_FOR_DELETION,
00044     WAIT_FOR_DELETION
00045   };
00046 
00047   PoseGraphInterface::TrajectoryState state =
00048       PoseGraphInterface::TrajectoryState::ACTIVE;
00049   DeletionState deletion_state = DeletionState::NORMAL;
00050 };
00051 
00052 struct InternalSubmapData {
00053   std::shared_ptr<const Submap> submap;
00054   SubmapState state = SubmapState::kNoConstraintSearch;
00055 
00056   // IDs of the nodes that were inserted into this map together with
00057   // constraints for them. They are not to be matched again when this submap
00058   // becomes 'kFinished'.
00059   std::set<NodeId> node_ids;
00060 };
00061 
00062 struct PoseGraphData {
00063   // Submaps get assigned an ID and state as soon as they are seen, even
00064   // before they take part in the background computations.
00065   MapById<SubmapId, InternalSubmapData> submap_data;
00066 
00067   // Global submap poses currently used for displaying data.
00068   MapById<SubmapId, optimization::SubmapSpec2D> global_submap_poses_2d;
00069   MapById<SubmapId, optimization::SubmapSpec3D> global_submap_poses_3d;
00070 
00071   // Data that are currently being shown.
00072   MapById<NodeId, TrajectoryNode> trajectory_nodes;
00073 
00074   // Global landmark poses with all observations.
00075   std::map<std::string /* landmark ID */, PoseGraphInterface::LandmarkNode>
00076       landmark_nodes;
00077 
00078   // How our various trajectories are related.
00079   TrajectoryConnectivityState trajectory_connectivity_state;
00080   int num_trajectory_nodes = 0;
00081   std::map<int, InternalTrajectoryState> trajectories_state;
00082 
00083   // Set of all initial trajectory poses.
00084   std::map<int, PoseGraph::InitialTrajectoryPose> initial_trajectory_poses;
00085 
00086   std::vector<PoseGraphInterface::Constraint> constraints;
00087 };
00088 
00089 }  // namespace mapping
00090 }  // namespace cartographer
00091 
00092 #endif  // CARTOGRAPHER_MAPPING_POSE_GRAPH_DATA_H_


cartographer
Author(s): The Cartographer Authors
autogenerated on Thu May 9 2019 02:27:35