global: use static method to construct AP_Rally

This commit is contained in:
Lucas De Marchi 2017-08-29 16:28:35 -07:00 committed by Francisco Ferreira
parent b4f5256a9e
commit b05610870c
8 changed files with 5 additions and 13 deletions

View File

@ -69,9 +69,6 @@ Copter::Copter(void)
#if AC_AVOID_ENABLED == ENABLED
avoid(ahrs, inertial_nav, fence, g2.proximity, &g2.beacon),
#endif
#if AC_RALLY == ENABLED
rally(ahrs),
#endif
#if SPRAYER == ENABLED
sprayer(&inertial_nav),
#endif

View File

@ -560,9 +560,10 @@ private:
#if AC_AVOID_ENABLED == ENABLED
AC_Avoid avoid;
#endif
// Rally library
#if AC_RALLY == ENABLED
AP_Rally_Copter rally;
AP_Rally_Copter rally = AP_Rally_Copter::create(ahrs);
#endif
// RSSI

View File

@ -283,8 +283,8 @@ private:
#endif
// Rally Ponints
AP_Rally rally {ahrs};
AP_Rally rally = AP_Rally::create(ahrs);
// RSSI
AP_RSSI rssi;

View File

@ -59,9 +59,6 @@ Sub::Sub(void)
pmTest1(0),
fast_loopTimer(0),
mainLoop_count(0),
#if AC_RALLY == ENABLED
rally(ahrs),
#endif
#if AP_TERRAIN_AVAILABLE && AC_TERRAIN
terrain(ahrs, mission, rally),
#endif

View File

@ -431,7 +431,7 @@ private:
// Rally library
#if AC_RALLY == ENABLED
AP_Rally rally;
AP_Rally rally = AP_Rally::create(ahrs);
#endif
// terrain handling

View File

@ -25,7 +25,6 @@
#include <AP_Math/AP_Math.h>
#include <AP_Notify/AP_Notify.h>
#include <AP_Notify/AP_BoardLED.h>
#include <AP_Rally/AP_Rally.h>
#include <AP_Scheduler/AP_Scheduler.h>
#include <AP_BattMonitor/AP_BattMonitor.h>
#include <AP_SerialManager/AP_SerialManager.h>

View File

@ -24,7 +24,6 @@
#include <AP_Terrain/AP_Terrain.h>
#include <AP_Math/AP_Math.h>
#include <AP_Notify/AP_Notify.h>
#include <AP_Rally/AP_Rally.h>
#include <AP_Scheduler/AP_Scheduler.h>
#include <AP_BattMonitor/AP_BattMonitor.h>
#include <AP_RangeFinder/AP_RangeFinder.h>

View File

@ -27,7 +27,6 @@
#include <AP_Notify/AP_Notify.h>
#include <AP_BattMonitor/AP_BattMonitor.h>
#include <AP_RangeFinder/AP_RangeFinder.h>
#include <AP_Rally/AP_Rally.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4