ArduSub: change AC_FENCE to AP_FENCE_ENABLED

This commit is contained in:
Iampete1 2022-07-19 12:33:13 +01:00 committed by Andrew Tridgell
parent a592f76282
commit cf1e1b2969
4 changed files with 6 additions and 6 deletions

View File

@ -244,7 +244,7 @@ void Sub::three_hz_loop()
// check if we've lost terrain data
failsafe_terrain_check();
#if AC_FENCE == ENABLED
#if AP_FENCE_ENABLED
// check if we have breached a fence
fence_check();
#endif // AP_FENCE_ENABLED

View File

@ -129,7 +129,7 @@ bool Sub::guided_set_destination(const Vector3f& destination)
guided_pos_control_start();
}
#if AC_FENCE == ENABLED
#if AP_FENCE_ENABLED
// reject destination if outside the fence
const Location dest_loc(destination, Location::AltFrame::ABOVE_ORIGIN);
if (!fence.check_destination_within_fence(dest_loc)) {
@ -157,7 +157,7 @@ bool Sub::guided_set_destination(const Location& dest_loc)
guided_pos_control_start();
}
#if AC_FENCE == ENABLED
#if AP_FENCE_ENABLED
// reject destination outside the fence.
// Note: there is a danger that a target specified as a terrain altitude might not be checked if the conversion to alt-above-home fails
if (!fence.check_destination_within_fence(dest_loc)) {
@ -201,7 +201,7 @@ bool Sub::guided_set_destination_posvel(const Vector3f& destination, const Vecto
guided_posvel_control_start();
}
#if AC_FENCE == ENABLED
#if AP_FENCE_ENABLED
// reject destination if outside the fence
const Location dest_loc(destination, Location::AltFrame::ABOVE_ORIGIN);
if (!fence.check_destination_within_fence(dest_loc)) {

View File

@ -2,7 +2,7 @@
// Code to integrate AC_Fence library with main ArduSub code
#if AC_FENCE == ENABLED
#if AP_FENCE_ENABLED
// fence_check - ask fence library to check for breaches and initiate the response
// called at 1hz

View File

@ -82,7 +82,7 @@ bool Sub::set_mode(control_mode_t mode, ModeReason reason)
camera.set_is_auto_mode(control_mode == AUTO);
#endif
#if AC_FENCE == ENABLED
#if AP_FENCE_ENABLED
// pilot requested flight mode change during a fence breach indicates pilot is attempting to manually recover
// this flight mode change could be automatic (i.e. fence, battery, GPS or GCS failsafe)
// but it should be harmless to disable the fence temporarily in these situations as well