From 1e9d0f59c065ec8b0b741e5fca694cc4fac61877 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 28 Jan 2022 11:09:42 +1100 Subject: [PATCH] AC_Avoidance: add and use AP_BEACON_ENABLED --- libraries/AC_Avoidance/AC_Avoid.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AC_Avoidance/AC_Avoid.cpp b/libraries/AC_Avoidance/AC_Avoid.cpp index b04748d645..0e402fc543 100644 --- a/libraries/AC_Avoidance/AC_Avoid.cpp +++ b/libraries/AC_Avoidance/AC_Avoid.cpp @@ -156,12 +156,14 @@ void AC_Avoid::adjust_velocity_fence(float kP, float accel_cmss, Vector3f &desir } #endif // AP_FENCE_ENABLED +#if AP_BEACON_ENABLED if ((_enabled & AC_AVOID_STOP_AT_BEACON_FENCE) > 0) { // Store velocity needed to back away from beacon fence Vector2f backup_vel_beacon; adjust_velocity_beacon_fence(kP, accel_cmss_limited, desired_velocity_xy_cms, backup_vel_beacon, dt); find_max_quadrant_velocity(backup_vel_beacon, quad_1_back_vel, quad_2_back_vel, quad_3_back_vel, quad_4_back_vel); } +#endif // AP_BEACON_ENABLED // check for vertical fence float desired_velocity_z_cms = desired_vel_cms.z; @@ -1089,6 +1091,7 @@ void AC_Avoid::adjust_velocity_exclusion_circles(float kP, float accel_cmss, Vec } #endif // AP_FENCE_ENABLED +#if AP_BEACON_ENABLED /* * Adjusts the desired velocity for the beacon fence. */ @@ -1117,6 +1120,7 @@ void AC_Avoid::adjust_velocity_beacon_fence(float kP, float accel_cmss, Vector2f #endif adjust_velocity_polygon(kP, accel_cmss, desired_vel_cms, backup_vel, boundary, num_points, margin, dt, true); } +#endif // AP_BEACON_ENABLED /* * Adjusts the desired velocity based on output from the proximity sensor