Browse Source

global: use static method to construct AC_Avoid

master
Lucas De Marchi 8 years ago committed by Francisco Ferreira
parent
commit
4f42facefc
  1. 3
      ArduCopter/Copter.cpp
  2. 2
      ArduCopter/Copter.h
  3. 3
      ArduSub/Sub.cpp
  4. 8
      ArduSub/Sub.h

3
ArduCopter/Copter.cpp

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

2
ArduCopter/Copter.h

@ -558,7 +558,7 @@ private: @@ -558,7 +558,7 @@ private:
#endif
#if AC_AVOID_ENABLED == ENABLED
AC_Avoid avoid;
AC_Avoid avoid = AC_Avoid::create(ahrs, inertial_nav, fence, g2.proximity, &g2.beacon);
#endif
// Rally library

3
ArduSub/Sub.cpp

@ -51,9 +51,6 @@ Sub::Sub(void) @@ -51,9 +51,6 @@ Sub::Sub(void)
pos_control(ahrs_view, inertial_nav, motors, attitude_control,
g.p_alt_hold, g.p_vel_z, g.pid_accel_z,
g.p_pos_xy, g.pi_vel_xy),
#if AVOIDANCE_ENABLED == ENABLED
avoid(ahrs, inertial_nav, fence, g2.proximity),
#endif
wp_nav(inertial_nav, ahrs_view, pos_control, attitude_control),
circle_nav(inertial_nav, ahrs_view, pos_control),
pmTest1(0),

8
ArduSub/Sub.h

@ -390,10 +390,6 @@ private: @@ -390,10 +390,6 @@ private:
AC_PosControl_Sub pos_control;
#if AVOIDANCE_ENABLED == ENABLED
AC_Avoid avoid;
#endif
AC_WPNav wp_nav;
AC_Circle circle_nav;
@ -429,6 +425,10 @@ private: @@ -429,6 +425,10 @@ private:
AC_Fence fence = AC_Fence::create(ahrs, inertial_nav);
#endif
#if AVOIDANCE_ENABLED == ENABLED
AC_Avoid avoid = AC_Avoid::create(ahrs, inertial_nav, fence, g2.proximity, &g2.beacon);
#endif
// Rally library
#if AC_RALLY == ENABLED
AP_Rally rally = AP_Rally::create(ahrs);

Loading…
Cancel
Save