Skip to content

Commit

Permalink
[EXAMPLE] Moved the wait for user before deletion of displays
Browse files Browse the repository at this point in the history
  • Loading branch information
rlagneau committed Jun 17, 2024
1 parent 9ed7506 commit 41c46be
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
9 changes: 5 additions & 4 deletions example/kalman/ukf-linear-example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,16 @@ int main(const int argc, const char *argv[])
z_prec = z;
}

if (opt_useDisplay) {
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();

Check warning on line 252 in example/kalman/ukf-linear-example.cpp

View check run for this annotation

Codecov / codecov/patch

example/kalman/ukf-linear-example.cpp#L252

Added line #L252 was not covered by tests
}

#ifdef VISP_HAVE_DISPLAY
if (opt_useDisplay) {
delete plot;

Check warning on line 257 in example/kalman/ukf-linear-example.cpp

View check run for this annotation

Codecov / codecov/patch

example/kalman/ukf-linear-example.cpp#L257

Added line #L257 was not covered by tests
}
#endif
if (opt_useDisplay) {
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
}

vpColVector X_GT({ gt_X[0], gt_vx, gt_X[1], gt_vy });
vpColVector finalError = ukf.getXest() - X_GT;
Expand Down
9 changes: 5 additions & 4 deletions example/kalman/ukf-nonlinear-complex-example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,15 +654,16 @@ int main(const int argc, const char *argv[])
#endif
}

if (opt_useDisplay) {
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();

Check warning on line 659 in example/kalman/ukf-nonlinear-complex-example.cpp

View check run for this annotation

Codecov / codecov/patch

example/kalman/ukf-nonlinear-complex-example.cpp#L659

Added line #L659 was not covered by tests
}

#ifdef VISP_HAVE_DISPLAY
if (opt_useDisplay) {
delete plot;

Check warning on line 664 in example/kalman/ukf-nonlinear-complex-example.cpp

View check run for this annotation

Codecov / codecov/patch

example/kalman/ukf-nonlinear-complex-example.cpp#L664

Added line #L664 was not covered by tests
}
#endif
if (opt_useDisplay) {
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
}

vpColVector finalError = grid.state_to_measurement(ukf.getXest()) - grid.measureGT(robot_pos);
const double maxError = 0.3;
Expand Down
9 changes: 5 additions & 4 deletions example/kalman/ukf-nonlinear-example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,15 +448,16 @@ int main(const int argc, const char *argv[])
gt_Vprec = gt_V;
}

if (opt_useDisplay) {
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();

Check warning on line 453 in example/kalman/ukf-nonlinear-example.cpp

View check run for this annotation

Codecov / codecov/patch

example/kalman/ukf-nonlinear-example.cpp#L453

Added line #L453 was not covered by tests
}

#ifdef VISP_HAVE_DISPLAY
if (opt_useDisplay) {
delete plot;

Check warning on line 458 in example/kalman/ukf-nonlinear-example.cpp

View check run for this annotation

Codecov / codecov/patch

example/kalman/ukf-nonlinear-example.cpp#L458

Added line #L458 was not covered by tests
}
#endif
if (opt_useDisplay) {
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
}

vpColVector X_GT({ gt_Xprec[0], gt_Vprec[0], gt_Xprec[1], gt_Vprec[1] });
vpColVector finalError = ukf.getXest() - X_GT;
Expand Down

0 comments on commit 41c46be

Please sign in to comment.