mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-09 08:54:05 +08:00
AP_Module: instantiate AP_Airspeed in ModuleTest example
AP::airspeed() now returns a reference, so code reached from this example which consults airspeed would dereference a null singleton if no AP_Airspeed object exists.
This commit is contained in:
committed by
Peter Barker
parent
3be2989526
commit
1ca11f1b19
@@ -3,6 +3,7 @@
|
||||
//
|
||||
|
||||
#include <AP_AHRS/AP_AHRS.h>
|
||||
#include <AP_Airspeed/AP_Airspeed.h>
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
#include <AP_Module/AP_Module.h>
|
||||
#include <AP_GPS/AP_GPS.h>
|
||||
@@ -24,6 +25,9 @@ static AP_InertialSensor ins;
|
||||
#endif // AP_EXTERNAL_AHRS_ENABLED
|
||||
static AP_GPS gps;
|
||||
static AP_Baro baro;
|
||||
#if AP_AIRSPEED_ENABLED
|
||||
static AP_Airspeed airspeed;
|
||||
#endif
|
||||
static AP_SerialManager serial_manager;
|
||||
|
||||
// choose which AHRS system to use
|
||||
|
||||
Reference in New Issue
Block a user