diff --git a/cartographer/mapping_2d/sparse_pose_graph.cc b/cartographer/mapping_2d/sparse_pose_graph.cc index 32af168..f462557 100644 --- a/cartographer/mapping_2d/sparse_pose_graph.cc +++ b/cartographer/mapping_2d/sparse_pose_graph.cc @@ -378,6 +378,7 @@ void SparsePoseGraph::WaitForAllComputations() { void SparsePoseGraph::FreezeTrajectory(const int trajectory_id) { common::MutexLocker locker(&mutex_); + trajectory_connectivity_state_.Add(trajectory_id); AddWorkItem([this, trajectory_id]() REQUIRES(mutex_) { CHECK_EQ(frozen_trajectories_.count(trajectory_id), 0); frozen_trajectories_.insert(trajectory_id); @@ -396,6 +397,7 @@ void SparsePoseGraph::AddSubmapFromProto(const int trajectory_id, const transform::Rigid2d initial_pose_2d = transform::Project2D(initial_pose); common::MutexLocker locker(&mutex_); + trajectory_connectivity_state_.Add(trajectory_id); const mapping::SubmapId submap_id = submap_data_.Append(trajectory_id, SubmapData()); submap_data_.at(submap_id).submap = submap_ptr; diff --git a/cartographer/mapping_3d/sparse_pose_graph.cc b/cartographer/mapping_3d/sparse_pose_graph.cc index dbecef8..1a0e5f0 100644 --- a/cartographer/mapping_3d/sparse_pose_graph.cc +++ b/cartographer/mapping_3d/sparse_pose_graph.cc @@ -400,6 +400,7 @@ void SparsePoseGraph::WaitForAllComputations() { void SparsePoseGraph::FreezeTrajectory(const int trajectory_id) { common::MutexLocker locker(&mutex_); + trajectory_connectivity_state_.Add(trajectory_id); AddWorkItem([this, trajectory_id]() REQUIRES(mutex_) { CHECK_EQ(frozen_trajectories_.count(trajectory_id), 0); frozen_trajectories_.insert(trajectory_id); @@ -417,6 +418,7 @@ void SparsePoseGraph::AddSubmapFromProto(const int trajectory_id, std::make_shared(submap.submap_3d()); common::MutexLocker locker(&mutex_); + trajectory_connectivity_state_.Add(trajectory_id); const mapping::SubmapId submap_id = submap_data_.Append(trajectory_id, SubmapData()); submap_data_.at(submap_id).submap = submap_ptr;