2011-12-21 00:30:22 -04:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
2011-11-13 02:42:20 -04:00
|
|
|
|
|
|
|
#ifndef __AP_INERTIAL_SENSOR_STUB_H__
|
|
|
|
#define __AP_INERTIAL_SENSOR_STUB_H__
|
|
|
|
|
2012-10-11 21:27:19 -03:00
|
|
|
#include <AP_Progmem.h>
|
2011-11-13 02:42:20 -04:00
|
|
|
#include "AP_InertialSensor.h"
|
|
|
|
|
2013-09-28 06:33:21 -03:00
|
|
|
class AP_InertialSensor_HIL : public AP_InertialSensor
|
2011-11-13 02:42:20 -04:00
|
|
|
{
|
2012-08-17 03:19:56 -03:00
|
|
|
public:
|
|
|
|
|
2013-09-28 06:33:21 -03:00
|
|
|
AP_InertialSensor_HIL();
|
2012-08-17 03:19:56 -03:00
|
|
|
|
|
|
|
/* Concrete implementation of AP_InertialSensor functions: */
|
|
|
|
bool update();
|
2014-01-02 20:46:24 -04:00
|
|
|
float get_delta_time() const;
|
2012-08-17 03:19:56 -03:00
|
|
|
float get_gyro_drift_rate();
|
2013-10-08 03:28:39 -03:00
|
|
|
bool wait_for_sample(uint16_t timeout_ms);
|
2014-02-22 17:16:33 -04:00
|
|
|
void set_accel(uint8_t instance, const Vector3f &accel);
|
|
|
|
void set_gyro(uint8_t instance, const Vector3f &gyro);
|
|
|
|
bool get_gyro_health(uint8_t instance) const;
|
|
|
|
bool get_accel_health(uint8_t instance) const;
|
2014-02-23 04:10:07 -04:00
|
|
|
uint8_t get_gyro_count(void) const;
|
|
|
|
uint8_t get_accel_count(void) const;
|
2012-11-07 02:20:22 -04:00
|
|
|
|
2013-12-08 05:43:53 -04:00
|
|
|
private:
|
|
|
|
bool _sample_available();
|
2012-10-11 21:27:19 -03:00
|
|
|
uint16_t _init_sensor( Sample_rate sample_rate );
|
2014-02-26 17:10:42 -04:00
|
|
|
uint32_t _sample_period_usec;
|
|
|
|
uint32_t _last_update_usec;
|
2014-02-22 17:16:33 -04:00
|
|
|
uint32_t _last_accel_usec[INS_MAX_INSTANCES];
|
|
|
|
uint32_t _last_gyro_usec[INS_MAX_INSTANCES];
|
2012-08-17 03:19:56 -03:00
|
|
|
};
|
2011-11-13 02:42:20 -04:00
|
|
|
|
|
|
|
#endif // __AP_INERTIAL_SENSOR_STUB_H__
|