2016-07-07 05:26:11 -03:00
|
|
|
//
|
|
|
|
// Simple test for the AP_AHRS interface
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <AP_ADC/AP_ADC.h>
|
|
|
|
#include <AP_AHRS/AP_AHRS.h>
|
|
|
|
#include <AP_HAL/AP_HAL.h>
|
|
|
|
#include <AP_Module/AP_Module.h>
|
|
|
|
|
2017-04-13 08:32:02 -03:00
|
|
|
void setup();
|
|
|
|
void loop();
|
|
|
|
|
2016-07-07 05:26:11 -03:00
|
|
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
|
|
|
|
|
|
|
// sensor declaration
|
2017-08-08 12:18:19 -03:00
|
|
|
static AP_InertialSensor ins = AP_InertialSensor::create();
|
2017-08-08 12:34:37 -03:00
|
|
|
static AP_GPS gps = AP_GPS::create();
|
2017-08-08 04:50:14 -03:00
|
|
|
static AP_Baro baro = AP_Baro::create();
|
2017-08-28 19:03:27 -03:00
|
|
|
static AP_SerialManager serial_manager = AP_SerialManager::create();
|
2016-07-07 05:26:11 -03:00
|
|
|
|
|
|
|
// choose which AHRS system to use
|
2017-08-30 05:15:47 -03:00
|
|
|
static AP_AHRS_DCM ahrs = AP_AHRS_DCM::create(ins, baro, gps);
|
2016-07-07 05:26:11 -03:00
|
|
|
|
|
|
|
void setup(void)
|
|
|
|
{
|
|
|
|
serial_manager.init();
|
|
|
|
ins.init(100);
|
|
|
|
baro.init();
|
|
|
|
ahrs.init();
|
|
|
|
|
2017-06-28 07:37:01 -03:00
|
|
|
gps.init(serial_manager);
|
2016-07-07 05:26:11 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
void loop(void)
|
|
|
|
{
|
|
|
|
ahrs.update();
|
|
|
|
}
|
|
|
|
|
|
|
|
AP_HAL_MAIN();
|