global: use static method to construct AP_GPS

This commit is contained in:
Lucas De Marchi 2017-08-08 08:34:37 -07:00 committed by Francisco Ferreira
parent 2cb2727a31
commit 8094482f21
11 changed files with 11 additions and 12 deletions

View File

@ -151,7 +151,7 @@ private:
DataFlash_Class DataFlash;
// sensor drivers
AP_GPS gps;
AP_GPS gps = AP_GPS::create();
AP_Baro barometer = AP_Baro::create();
Compass compass = Compass::create();
AP_InertialSensor ins = AP_InertialSensor::create();

View File

@ -104,7 +104,7 @@ private:
DataFlash_Class DataFlash;
AP_GPS gps;
AP_GPS gps = AP_GPS::create();
AP_Baro barometer = AP_Baro::create();

View File

@ -192,7 +192,7 @@ private:
// Dataflash
DataFlash_Class DataFlash;
AP_GPS gps;
AP_GPS gps = AP_GPS::create();
// flight modes convenience array
AP_Int8 *flight_modes;

View File

@ -195,7 +195,7 @@ private:
int32_t pitch_limit_min_cd;
// Sensors
AP_GPS gps;
AP_GPS gps = AP_GPS::create();
// flight modes convenience array
AP_Int8 *flight_modes = &g.flight_mode1;

View File

@ -161,7 +161,7 @@ private:
// Dataflash
DataFlash_Class DataFlash;
AP_GPS gps;
AP_GPS gps = AP_GPS::create();
AP_LeakDetector leak_detector;

View File

@ -60,7 +60,7 @@ public:
AP_InertialSensor ins = AP_InertialSensor::create();
AP_Baro barometer = AP_Baro::create();
AP_GPS gps;
AP_GPS gps = AP_GPS::create();
Compass compass = Compass::create();
AP_SerialManager serial_manager;
RangeFinder rng {serial_manager, ROTATION_PITCH_270};

View File

@ -17,7 +17,7 @@ static AP_InertialSensor ins = AP_InertialSensor::create();
static Compass compass = Compass::create();
AP_GPS gps;
static AP_GPS gps = AP_GPS::create();
static AP_Baro barometer = AP_Baro::create();
AP_SerialManager serial_manager;

View File

@ -41,8 +41,7 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL();
AP_BoardLED board_led;
// This example uses GPS system. Create it.
AP_GPS gps;
static AP_GPS gps = AP_GPS::create();
// Serial manager is needed for UART comunications
AP_SerialManager serial_manager;

View File

@ -16,7 +16,7 @@ public:
private:
AP_InertialSensor ins = AP_InertialSensor::create();
AP_Baro baro = AP_Baro::create();
AP_GPS gps;
AP_GPS gps = AP_GPS::create();
Compass compass = Compass::create();
AP_AHRS_DCM ahrs{ins, baro, gps};

View File

@ -14,7 +14,7 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL();
// sensor declaration
static AP_InertialSensor ins = AP_InertialSensor::create();
AP_GPS gps;
static AP_GPS gps = AP_GPS::create();
static AP_Baro baro = AP_Baro::create();
AP_SerialManager serial_manager;

View File

@ -21,7 +21,7 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL();
class DummyVehicle {
public:
AP_GPS gps;
AP_GPS gps = AP_GPS::create();
AP_Baro barometer = AP_Baro::create();
Compass compass = Compass::create();
AP_InertialSensor ins = AP_InertialSensor::create();