ardupilot/libraries/AP_Module/examples/ModuleTest/ModuleTest.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
925 B
C++
Raw Normal View History

//
// Simple test for the AP_AHRS interface
//
#include <AP_AHRS/AP_AHRS.h>
#include <AP_HAL/AP_HAL.h>
#include <AP_Module/AP_Module.h>
2019-06-13 23:57:54 -03:00
#include <AP_GPS/AP_GPS.h>
2019-06-27 00:43:17 -03:00
#include <AP_Baro/AP_Baro.h>
2021-02-09 08:56:23 -04:00
#include <AP_ExternalAHRS/AP_ExternalAHRS.h>
#include <GCS_MAVLink/GCS_Dummy.h>
const struct AP_Param::GroupInfo GCS_MAVLINK_Parameters::var_info[] = {
AP_GROUPEND
};
GCS_Dummy _gcs;
void setup();
void loop();
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
// sensor declaration
static AP_InertialSensor ins;
2021-02-09 08:56:23 -04:00
#if HAL_EXTERNAL_AHRS_ENABLED
2021-02-09 10:09:51 -04:00
static AP_ExternalAHRS eAHRS;
2021-02-09 08:56:23 -04:00
#endif // HAL_EXTERNAL_AHRS_ENABLED
static AP_GPS gps;
static AP_Baro baro;
static AP_SerialManager serial_manager;
// choose which AHRS system to use
static AP_AHRS ahrs{};
void setup(void)
{
serial_manager.init();
ins.init(100);
baro.init();
ahrs.init();
gps.init();
}
void loop(void)
{
ahrs.update();
}
AP_HAL_MAIN();