Change num_submaps_in_trajectory to using trajectory IDs. (#277)

Related to #256.
master
Holger Rapp 2017-05-11 14:32:55 +02:00 committed by GitHub
parent 7b1915b906
commit 1a9b18db69
4 changed files with 6 additions and 8 deletions

View File

@ -118,8 +118,8 @@ void SparsePoseGraph::AddScan(
submap_states_.emplace_back(); submap_states_.emplace_back();
submap_states_.back().submap = insertion_submaps.back(); submap_states_.back().submap = insertion_submaps.back();
submap_states_.back().id = mapping::SubmapId{ submap_states_.back().id = mapping::SubmapId{
trajectory_id, num_submaps_in_trajectory_[trajectory]}; trajectory_id, num_submaps_in_trajectory_[trajectory_id]};
++num_submaps_in_trajectory_[trajectory]; ++num_submaps_in_trajectory_[trajectory_id];
CHECK_EQ(submap_states_.size(), submap_indices_.size()); CHECK_EQ(submap_states_.size(), submap_indices_.size());
} }
const mapping::Submap* const finished_submap = const mapping::Submap* const finished_submap =

View File

@ -198,8 +198,7 @@ class SparsePoseGraph : public mapping::SparsePoseGraph {
// before they take part in the background computations. // before they take part in the background computations.
std::map<const mapping::Submap*, int> submap_indices_ GUARDED_BY(mutex_); std::map<const mapping::Submap*, int> submap_indices_ GUARDED_BY(mutex_);
std::vector<SubmapState> submap_states_ GUARDED_BY(mutex_); std::vector<SubmapState> submap_states_ GUARDED_BY(mutex_);
std::map<const mapping::Submaps*, int> num_submaps_in_trajectory_ std::map<int, int> num_submaps_in_trajectory_ GUARDED_BY(mutex_);
GUARDED_BY(mutex_);
// Connectivity structure of our trajectories by IDs. // Connectivity structure of our trajectories by IDs.
std::vector<std::vector<int>> connected_components_; std::vector<std::vector<int>> connected_components_;

View File

@ -115,8 +115,8 @@ void SparsePoseGraph::AddScan(
submap_states_.emplace_back(); submap_states_.emplace_back();
submap_states_.back().submap = insertion_submaps.back(); submap_states_.back().submap = insertion_submaps.back();
submap_states_.back().id = mapping::SubmapId{ submap_states_.back().id = mapping::SubmapId{
trajectory_id, num_submaps_in_trajectory_[trajectory]}; trajectory_id, num_submaps_in_trajectory_[trajectory_id]};
++num_submaps_in_trajectory_[trajectory]; ++num_submaps_in_trajectory_[trajectory_id];
CHECK_EQ(submap_states_.size(), submap_indices_.size()); CHECK_EQ(submap_states_.size(), submap_indices_.size());
} }
const Submap* const finished_submap = const Submap* const finished_submap =

View File

@ -198,8 +198,7 @@ class SparsePoseGraph : public mapping::SparsePoseGraph {
// before they take part in the background computations. // before they take part in the background computations.
std::map<const mapping::Submap*, int> submap_indices_ GUARDED_BY(mutex_); std::map<const mapping::Submap*, int> submap_indices_ GUARDED_BY(mutex_);
std::vector<SubmapState> submap_states_ GUARDED_BY(mutex_); std::vector<SubmapState> submap_states_ GUARDED_BY(mutex_);
std::map<const mapping::Submaps*, int> num_submaps_in_trajectory_ std::map<int, int> num_submaps_in_trajectory_ GUARDED_BY(mutex_);
GUARDED_BY(mutex_);
// Connectivity structure of our trajectories by IDs. // Connectivity structure of our trajectories by IDs.
std::vector<std::vector<int>> connected_components_; std::vector<std::vector<int>> connected_components_;