mirror of https://github.com/ArduPilot/ardupilot
geofence: re-breach if user changes mode outside the fence
if the user changes mode while outside the fence, and fencing is still enabled, then declare a new breach
This commit is contained in:
parent
f8e1d88815
commit
c91827ee09
|
@ -235,13 +235,12 @@ static void geofence_check(bool altitude_check_only)
|
|||
}
|
||||
|
||||
// we are outside the fence
|
||||
if (geofence_state->fence_triggered) {
|
||||
if (geofence_state->fence_triggered && control_mode == GUIDED) {
|
||||
// we have already triggered, don't trigger again until the
|
||||
// user disables/re-enables using the fence channel switch
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// we are outside, and have not previously triggered.
|
||||
geofence_state->fence_triggered = true;
|
||||
geofence_state->breach_count++;
|
||||
|
|
Loading…
Reference in New Issue