Browse Source

AC_Fence: get home distance directly from ahrs

master
Peter Barker 7 years ago committed by Francisco Ferreira
parent
commit
0f94fde434
  1. 6
      libraries/AC_Fence/AC_Fence.cpp
  2. 7
      libraries/AC_Fence/AC_Fence.h

6
libraries/AC_Fence/AC_Fence.cpp

@ -241,6 +241,12 @@ bool AC_Fence::check_fence_circle() @@ -241,6 +241,12 @@ bool AC_Fence::check_fence_circle()
return false;
}
Vector2f home;
if (_ahrs.get_relative_position_NE_home(home)) {
// we (may) remain breached if we can't update home
_home_distance = home.length();
}
// check if we are outside the fence
if (_home_distance >= _circle_radius) {

7
libraries/AC_Fence/AC_Fence.h

@ -95,13 +95,6 @@ public: @@ -95,13 +95,6 @@ public:
/// has no effect if no breaches have occurred
void manual_recovery_start();
///
/// time saving methods to piggy-back on main code's calculations
///
/// set_home_distance - update vehicle's distance from home in meters - required for circular horizontal fence monitoring
void set_home_distance(float distance) { _home_distance = distance; }
///
/// polygon related methods
///

Loading…
Cancel
Save