diff --git a/ArduPlane/commands_logic.cpp b/ArduPlane/commands_logic.cpp index 4766cea5c1..fc87bb4ad6 100644 --- a/ArduPlane/commands_logic.cpp +++ b/ArduPlane/commands_logic.cpp @@ -147,10 +147,10 @@ bool Plane::start_command(const AP_Mission::Mission_Command& cmd) case MAV_CMD_DO_FENCE_ENABLE: #if AP_FENCE_ENABLED if (cmd.p1 == 0) { // disable fence - plane.fence.enable(false); + plane.fence.enable_configured(false); gcs().send_text(MAV_SEVERITY_INFO, "Fence disabled"); } else if (cmd.p1 == 1) { // enable fence - plane.fence.enable(true); + plane.fence.enable_configured(true); gcs().send_text(MAV_SEVERITY_INFO, "Fence enabled"); } else if (cmd.p1 == 2) { // disable fence floor only plane.fence.disable_floor(); diff --git a/ArduPlane/fence.cpp b/ArduPlane/fence.cpp index bef88306eb..9615082244 100644 --- a/ArduPlane/fence.cpp +++ b/ArduPlane/fence.cpp @@ -115,7 +115,8 @@ void Plane::fence_check() } LOGGER_WRITE_ERROR(LogErrorSubsystem::FAILSAFE_FENCE, LogErrorCode(new_breaches)); - } else if (orig_breaches) { + } else if (orig_breaches && fence.get_breaches() == 0) { + GCS_SEND_TEXT(MAV_SEVERITY_NOTICE, "Fence breach cleared"); // record clearing of breach LOGGER_WRITE_ERROR(LogErrorSubsystem::FAILSAFE_FENCE, LogErrorCode::ERROR_RESOLVED); }