Copter: GPS Failsafe switch to LAND if circular fence enabled

This commit is contained in:
Randy Mackay 2013-06-26 11:56:58 +09:00
parent 4fd4ef3400
commit 3ce005a436
1 changed files with 5 additions and 0 deletions

View File

@ -140,6 +140,11 @@ static void failsafe_gps_check()
// take action based on flight mode
if(mode_requires_GPS(control_mode))
set_mode(LAND);
// land if circular fence is enabled
if((fence.get_enabled_fences() & AC_FENCE_TYPE_CIRCLE) != 0) {
set_mode(LAND);
}
}
// failsafe_gps_off_event - actions to take when GPS contact is restored