2011-12-21 00:30:22 -04:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
2011-11-12 23:20:25 -04:00
|
|
|
|
|
|
|
#ifndef __AP_INERTIAL_SENSOR_OILPAN_H__
|
|
|
|
#define __AP_INERTIAL_SENSOR_OILPAN_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2012-10-11 21:27:19 -03:00
|
|
|
#include <AP_ADC.h>
|
|
|
|
#include <AP_Math.h>
|
2011-11-12 23:20:25 -04:00
|
|
|
#include "AP_InertialSensor.h"
|
|
|
|
|
|
|
|
class AP_InertialSensor_Oilpan : public AP_InertialSensor
|
|
|
|
{
|
2012-08-17 03:19:56 -03:00
|
|
|
public:
|
2011-11-12 23:20:25 -04:00
|
|
|
|
2012-08-17 03:19:56 -03:00
|
|
|
AP_InertialSensor_Oilpan( AP_ADC * adc );
|
2011-11-12 23:20:25 -04:00
|
|
|
|
2012-08-17 03:19:56 -03:00
|
|
|
/* Concrete implementation of AP_InertialSensor functions: */
|
|
|
|
bool update();
|
2013-01-11 06:17:21 -04:00
|
|
|
float get_delta_time(); // get_delta_time returns the time period in seconds overwhich the sensor data was collected
|
2012-11-05 00:27:03 -04:00
|
|
|
//uint32_t get_last_sample_time_micros(); // last_sample_time - get time (in microseconds) that last sample was captured
|
2012-08-17 03:19:56 -03:00
|
|
|
float get_gyro_drift_rate();
|
2011-11-12 23:20:25 -04:00
|
|
|
|
2012-08-30 04:48:36 -03:00
|
|
|
// get number of samples read from the sensors
|
|
|
|
uint16_t num_samples_available();
|
|
|
|
|
2012-11-07 02:20:22 -04:00
|
|
|
protected:
|
2012-10-11 21:27:19 -03:00
|
|
|
uint16_t _init_sensor(Sample_rate sample_rate);
|
2012-11-07 02:20:22 -04:00
|
|
|
|
2012-08-17 03:19:56 -03:00
|
|
|
private:
|
2012-07-19 02:56:13 -03:00
|
|
|
|
2012-08-17 03:19:56 -03:00
|
|
|
AP_ADC * _adc;
|
2012-07-19 02:56:13 -03:00
|
|
|
|
2012-08-17 03:19:56 -03:00
|
|
|
float _temp;
|
2011-11-12 23:20:25 -04:00
|
|
|
|
2012-11-05 00:27:03 -04:00
|
|
|
uint32_t _delta_time_micros;
|
2011-11-12 23:20:25 -04:00
|
|
|
|
2012-08-17 03:19:56 -03:00
|
|
|
static const uint8_t _sensors[6];
|
|
|
|
static const int8_t _sensor_signs[6];
|
|
|
|
static const uint8_t _gyro_temp_ch;
|
2011-11-12 23:20:25 -04:00
|
|
|
|
2012-08-17 03:19:56 -03:00
|
|
|
static const float _gyro_gain_x;
|
|
|
|
static const float _gyro_gain_y;
|
|
|
|
static const float _gyro_gain_z;
|
2011-11-12 23:20:25 -04:00
|
|
|
|
2012-08-17 03:19:56 -03:00
|
|
|
static const float _adc_constraint;
|
2012-11-29 07:56:13 -04:00
|
|
|
|
|
|
|
uint8_t _sample_threshold;
|
2011-11-12 23:20:25 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_INERTIAL_SENSOR_OILPAN_H__
|