navigator: do not emit geofence warnings if system is not armed

Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
RomanBapst 2021-05-06 14:42:32 +03:00 committed by Roman Bapst
parent e87a6c755d
commit 6215e6c7ec
1 changed files with 2 additions and 2 deletions

View File

@ -767,8 +767,8 @@ void Navigator::geofence_breach_check(bool &have_geofence_position_data)
/* inform other apps via the mission result */ /* inform other apps via the mission result */
_geofence_result.geofence_violated = true; _geofence_result.geofence_violated = true;
/* Issue a warning about the geofence violation once */ /* Issue a warning about the geofence violation once and only if we are armed */
if (!_geofence_violation_warning_sent) { if (!_geofence_violation_warning_sent && _vstatus.arming_state == vehicle_status_s::ARMING_STATE_ARMED) {
mavlink_log_critical(&_mavlink_log_pub, "Approaching on Geofence"); mavlink_log_critical(&_mavlink_log_pub, "Approaching on Geofence");
// we have predicted a geofence violation and if the action is to loiter then // we have predicted a geofence violation and if the action is to loiter then