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