From 542ca96d3edac0496a128c3a98e79175c7828b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tuomas=20J=C3=A4rvinen?= Date: Wed, 22 May 2024 20:15:26 +0200 Subject: [PATCH] Improve use of MAVSDK::Action module Added more logging. Type: Improvement Issue: https://denyspopov.atlassian.net/browse/AZ-19 --- src/az_drone_controller.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/az_drone_controller.cpp b/src/az_drone_controller.cpp index 0f6adb4..870948f 100644 --- a/src/az_drone_controller.cpp +++ b/src/az_drone_controller.cpp @@ -28,7 +28,7 @@ AzDroneController::AzDroneController(AzMission &mission, QObject *parent) this, &AzDroneController::missionIndexChangedSlot); - // Mission controller signal to the slot in this class to finish the flying. + // Mission controller signals end of the missions. This will be used to fly to the return point in JSON. connect(mMissionController, &AzMissionController::finished, this, &AzDroneController::missionFinishedSlot); // Healt info update from MAVSDK. @@ -113,14 +113,16 @@ bool AzDroneController::stateTelemetryModule(void) bool AzDroneController::stateActionModule(void) { - // TODO!! Check return value and print warnings and errors. mAction = new Action(mSystem); - if (mAction == nullptr) { + + if (mAction != nullptr) { + mMissionController->setAction(mAction); + return true; + } + else { + qWarning() << "Creating new MAVSDK::Action failed"; return false; } - - mMissionController->setAction(mAction); - return true; } bool AzDroneController::stateReadyForArming(void)