Fixing 846 without tests. (#1183)
Fixing "Optimizing: -nan%... #846" https://github.com/googlecartographer/cartographer/issues/846. The issue was triggered in a multithreaded execution, when all nodes were processed, but the working queue was still non empty (having other kind of jobs). Unfortunately I failed to reproduce the bug in tests, so no new tests were added.master
parent
4ef38497a9
commit
3f0bb0eec5
|
@ -397,6 +397,8 @@ void PoseGraph2D::WaitForAllComputations() {
|
||||||
!work_queue_);
|
!work_queue_);
|
||||||
},
|
},
|
||||||
common::FromSeconds(1.))) {
|
common::FromSeconds(1.))) {
|
||||||
|
// Log progress on nodes only when we are actually processing nodes.
|
||||||
|
if (num_trajectory_nodes_ != num_finished_nodes_at_start) {
|
||||||
std::ostringstream progress_info;
|
std::ostringstream progress_info;
|
||||||
progress_info << "Optimizing: " << std::fixed << std::setprecision(1)
|
progress_info << "Optimizing: " << std::fixed << std::setprecision(1)
|
||||||
<< 100. *
|
<< 100. *
|
||||||
|
@ -406,6 +408,7 @@ void PoseGraph2D::WaitForAllComputations() {
|
||||||
<< "%...";
|
<< "%...";
|
||||||
std::cout << "\r\x1b[K" << progress_info.str() << std::flush;
|
std::cout << "\r\x1b[K" << progress_info.str() << std::flush;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
std::cout << "\r\x1b[KOptimizing: Done. " << std::endl;
|
std::cout << "\r\x1b[KOptimizing: Done. " << std::endl;
|
||||||
constraint_builder_.WhenDone(
|
constraint_builder_.WhenDone(
|
||||||
[this,
|
[this,
|
||||||
|
|
|
@ -412,6 +412,8 @@ void PoseGraph3D::WaitForAllComputations() {
|
||||||
!work_queue_);
|
!work_queue_);
|
||||||
},
|
},
|
||||||
common::FromSeconds(1.))) {
|
common::FromSeconds(1.))) {
|
||||||
|
// Log progress on nodes only when we are actually processing nodes.
|
||||||
|
if (num_trajectory_nodes_ != num_finished_nodes_at_start) {
|
||||||
std::ostringstream progress_info;
|
std::ostringstream progress_info;
|
||||||
progress_info << "Optimizing: " << std::fixed << std::setprecision(1)
|
progress_info << "Optimizing: " << std::fixed << std::setprecision(1)
|
||||||
<< 100. *
|
<< 100. *
|
||||||
|
@ -421,6 +423,7 @@ void PoseGraph3D::WaitForAllComputations() {
|
||||||
<< "%...";
|
<< "%...";
|
||||||
std::cout << "\r\x1b[K" << progress_info.str() << std::flush;
|
std::cout << "\r\x1b[K" << progress_info.str() << std::flush;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
std::cout << "\r\x1b[KOptimizing: Done. " << std::endl;
|
std::cout << "\r\x1b[KOptimizing: Done. " << std::endl;
|
||||||
constraint_builder_.WhenDone(
|
constraint_builder_.WhenDone(
|
||||||
[this,
|
[this,
|
||||||
|
|
Loading…
Reference in New Issue