mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 13:46:34 +00:00
Land drone safely
- improved landing - navigate to the return point defined in JSON file - land drone safely without timeouts Issue: https://denyspopov.atlassian.net/browse/AZ-24 Type: New Feature
This commit is contained in:
@@ -168,20 +168,13 @@ bool AzDroneController::stateFlyMission(void)
|
||||
|
||||
void AzDroneController::missionFinishedSlot(void)
|
||||
{
|
||||
qDebug() << "AzDroneController::missionFinishedSlot() Landing the drone.";
|
||||
// TODO!! Check return value and print warnings and errors.
|
||||
mAction->land();
|
||||
// TODO!! This must be improved a lot. Disarming should be done when drone lands.
|
||||
QTimer::singleShot(20000, this, &AzDroneController::disarmDroneSlot);
|
||||
}
|
||||
// TODO!! Maybe use Telemetry::subscribe_landed_state() later to get the state of the landing.
|
||||
qDebug() << "AzDroneController::missionFinishedSlot() Mission finished. Landing the drone.";
|
||||
Action::Result result = mAction->land();
|
||||
|
||||
void AzDroneController::disarmDroneSlot(void)
|
||||
{
|
||||
qDebug() << "AzDroneController::disarmDroneSlot() Disarming the drone and quit.";
|
||||
// TODO!! Check return value and print warnings and errors.
|
||||
mAction->disarm();
|
||||
// TODO!! Check with the team what to do after the landing.
|
||||
QCoreApplication::instance()->quit();
|
||||
if (result != Action::Result::Success) {
|
||||
std::cerr << "mAction->land() failed. Reason: " << result << endl;
|
||||
}
|
||||
}
|
||||
|
||||
void AzDroneController::droneStateMachineSlot(void)
|
||||
|
||||
Reference in New Issue
Block a user