From 7f4758b5dcc69a80248b7af2865f7f0ab6abd5e5 Mon Sep 17 00:00:00 2001 From: Michael Ripperger Date: Thu, 1 Aug 2024 20:56:00 -0400 Subject: [PATCH] Updated checks for applications (#202) --- gui/src/app/camera_intrinsic_calibration_app.cpp | 5 +++-- gui/src/app/extrinsic_hand_eye_calibration_app.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gui/src/app/camera_intrinsic_calibration_app.cpp b/gui/src/app/camera_intrinsic_calibration_app.cpp index 20461dd8..ed5a42ea 100644 --- a/gui/src/app/camera_intrinsic_calibration_app.cpp +++ b/gui/src/app/camera_intrinsic_calibration_app.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -65,12 +66,12 @@ int main(int argc, char** argv) // Attempt to load configuration and observations files if available try { - if (argc > 1) + if (argc > 1 && std::filesystem::is_regular_file(argv[1])) { w.loadConfig(argv[1]); QMessageBox::information(nullptr, "Configuration", "Successfully loaded calibration configuration"); } - if (argc > 2) + if (argc > 2 && std::filesystem::is_regular_file(argv[2])) w.loadObservations(argv[2]); } catch (const std::exception& ex) diff --git a/gui/src/app/extrinsic_hand_eye_calibration_app.cpp b/gui/src/app/extrinsic_hand_eye_calibration_app.cpp index 23429e63..3e235446 100644 --- a/gui/src/app/extrinsic_hand_eye_calibration_app.cpp +++ b/gui/src/app/extrinsic_hand_eye_calibration_app.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -58,12 +59,12 @@ int main(int argc, char** argv) // Attempt to load configuration and observations files if available try { - if (argc > 1) + if (argc > 1 && std::filesystem::is_regular_file(argv[1])) { w.loadConfig(argv[1]); QMessageBox::information(nullptr, "Configuration", "Successfully loaded calibration configuration"); } - if (argc > 2) + if (argc > 2 && std::filesystem::is_regular_file(argv[2])) w.loadObservations(argv[2]); } catch (const std::exception& ex)