From 41c46be336572f5a62fe925bf5be340a34214761 Mon Sep 17 00:00:00 2001 From: rlagneau Date: Mon, 17 Jun 2024 16:36:31 +0200 Subject: [PATCH] [EXAMPLE] Moved the wait for user before deletion of displays --- example/kalman/ukf-linear-example.cpp | 9 +++++---- example/kalman/ukf-nonlinear-complex-example.cpp | 9 +++++---- example/kalman/ukf-nonlinear-example.cpp | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/example/kalman/ukf-linear-example.cpp b/example/kalman/ukf-linear-example.cpp index 62b893f4d3..030b0f2b95 100644 --- a/example/kalman/ukf-linear-example.cpp +++ b/example/kalman/ukf-linear-example.cpp @@ -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(); + } + #ifdef VISP_HAVE_DISPLAY if (opt_useDisplay) { delete plot; } #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; diff --git a/example/kalman/ukf-nonlinear-complex-example.cpp b/example/kalman/ukf-nonlinear-complex-example.cpp index 719789cce6..adbdb4ef2a 100644 --- a/example/kalman/ukf-nonlinear-complex-example.cpp +++ b/example/kalman/ukf-nonlinear-complex-example.cpp @@ -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(); + } + #ifdef VISP_HAVE_DISPLAY if (opt_useDisplay) { delete plot; } #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; diff --git a/example/kalman/ukf-nonlinear-example.cpp b/example/kalman/ukf-nonlinear-example.cpp index 38e611e582..067ad1b6ad 100644 --- a/example/kalman/ukf-nonlinear-example.cpp +++ b/example/kalman/ukf-nonlinear-example.cpp @@ -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(); + } + #ifdef VISP_HAVE_DISPLAY if (opt_useDisplay) { delete plot; } #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;