WaitForAllComputation waits for work queue (#754)
parent
59d1b968bc
commit
f8452821d7
|
@ -60,7 +60,7 @@ class PoseGraphInterface {
|
|||
PoseGraphInterface(const PoseGraphInterface&) = delete;
|
||||
PoseGraphInterface& operator=(const PoseGraphInterface&) = delete;
|
||||
|
||||
// Computes optimized poses.
|
||||
// Waits for all computations to finish and computes optimized poses.
|
||||
virtual void RunFinalOptimization() = 0;
|
||||
|
||||
// Returns data for all submaps.
|
||||
|
|
|
@ -351,8 +351,9 @@ void PoseGraph::WaitForAllComputations() {
|
|||
constraint_builder_.GetNumFinishedNodes();
|
||||
while (!locker.AwaitWithTimeout(
|
||||
[this]() REQUIRES(mutex_) {
|
||||
return constraint_builder_.GetNumFinishedNodes() ==
|
||||
num_trajectory_nodes_;
|
||||
return ((constraint_builder_.GetNumFinishedNodes() ==
|
||||
num_trajectory_nodes_) &&
|
||||
!work_queue_);
|
||||
},
|
||||
common::FromSeconds(1.))) {
|
||||
std::ostringstream progress_info;
|
||||
|
|
Loading…
Reference in New Issue