mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 21:31:40 +08:00
navigator: do not emit geofence warnings if system is not armed
Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user