From 8f1019a2ec482fa084e462d01723656446b09977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tuomas=20J=C3=A4rvinen?= Date: Wed, 22 May 2024 20:08:21 +0200 Subject: [PATCH] Improve arming of the drone in Autopilot Improved logging. Type: Improvement Issue: https://denyspopov.atlassian.net/browse/AZ-21 --- src/az_drone_controller.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/az_drone_controller.cpp b/src/az_drone_controller.cpp index 9c15692..0f6adb4 100644 --- a/src/az_drone_controller.cpp +++ b/src/az_drone_controller.cpp @@ -136,8 +136,15 @@ bool AzDroneController::stateReadyForArming(void) bool AzDroneController::stateArm(void) { - // TODO!! Check return value and print warnings and errors. - return mAction->arm() == Action::Result::Success; + Action::Result result = mAction->arm(); + + if (result == Action::Result::Success) { + return true; + } + else { + std::cerr << "MAVSDK::Action::arm() failed. Reason: " << result << endl; + return false; + } } bool AzDroneController::stateTakeoff(void)