Path: blob/master/libraries/AP_Compass/AP_Compass_SITL.h
9593 views
#pragma once12#include "AP_Compass.h"34#if AP_COMPASS_SITL_ENABLED56#include "AP_Compass_Backend.h"78#include <AP_Math/vectorN.h>9#include <AP_Math/AP_Math.h>10#include <AP_Declination/AP_Declination.h>11#include <SITL/SITL.h>1213class AP_Compass_SITL : public AP_Compass_Backend {14public:15AP_Compass_SITL(uint8_t sitl_instance);1617void read(void) override;1819private:20SITL::SIM *_sitl;2122// delay buffer variables23struct readings_compass {24uint32_t time;25Vector3f data;26};27uint8_t store_index;28uint32_t last_store_time;29static const uint8_t buffer_length = 50;30VectorN<readings_compass,buffer_length> buffer;3132void _timer();33uint32_t _last_sample_time;3435void _setup_eliptical_correcion();3637uint8_t sitl_instance; // offset into SITL state structure arrays38Matrix3f _eliptical_corr;39Vector3f _last_dia;40Vector3f _last_odi;41Vector3f _last_data;42};43#endif // AP_COMPASS_SITL_ENABLED444546