global: use static method to construct AC_Fence

This commit is contained in:
Lucas De Marchi 2017-08-29 16:06:26 -07:00 committed by Francisco Ferreira
parent 52686ec838
commit c6eb48009b
4 changed files with 3 additions and 8 deletions

View File

@ -66,9 +66,6 @@ Copter::Copter(void)
mainLoop_count(0),
rtl_loiter_start_time(0),
auto_trim_counter(0),
#if AC_FENCE == ENABLED
fence(ahrs, inertial_nav),
#endif
#if AC_AVOID_ENABLED == ENABLED
avoid(ahrs, inertial_nav, fence, g2.proximity, &g2.beacon),
#endif

View File

@ -554,8 +554,9 @@ private:
// AC_Fence library to reduce fly-aways
#if AC_FENCE == ENABLED
AC_Fence fence;
AC_Fence fence = AC_Fence::create(ahrs, inertial_nav);
#endif
#if AC_AVOID_ENABLED == ENABLED
AC_Avoid avoid;
#endif

View File

@ -59,9 +59,6 @@ Sub::Sub(void)
pmTest1(0),
fast_loopTimer(0),
mainLoop_count(0),
#if AC_FENCE == ENABLED
fence(ahrs, inertial_nav),
#endif
#if AC_RALLY == ENABLED
rally(ahrs),
#endif

View File

@ -426,7 +426,7 @@ private:
// AC_Fence library to reduce fly-aways
#if AC_FENCE == ENABLED
AC_Fence fence;
AC_Fence fence = AC_Fence::create(ahrs, inertial_nav);
#endif
// Rally library