Improve arming of the drone in Autopilot

Improved logging.

Type: Improvement
Issue: https://denyspopov.atlassian.net/browse/AZ-21
This commit is contained in:
Tuomas Järvinen
2024-05-22 20:08:21 +02:00
parent 85e4546ad4
commit 8f1019a2ec
+9 -2
View File
@@ -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)