2010-12-10 06:17:27 -04:00
|
|
|
#ifndef AP_DCM_HIL_H
|
|
|
|
#define AP_DCM_HIL_H
|
|
|
|
|
2011-04-30 23:05:17 -03:00
|
|
|
#include "../FastSerial/FastSerial.h"
|
|
|
|
#include "../AP_Math/AP_Math.h"
|
2010-12-10 06:17:27 -04:00
|
|
|
#include <inttypes.h>
|
2011-04-30 23:05:17 -03:00
|
|
|
#include "../AP_Compass/AP_Compass.h"
|
|
|
|
#include "../AP_ADC/AP_ADC.h"
|
|
|
|
#include "../AP_GPS/AP_GPS.h"
|
|
|
|
#include "../AP_IMU/AP_IMU.h"
|
2012-01-27 23:25:47 -04:00
|
|
|
#if defined(ARDUINO) && ARDUINO >= 100
|
|
|
|
#include "Arduino.h"
|
|
|
|
#else
|
|
|
|
#include "WProgram.h"
|
|
|
|
#endif
|
2010-12-10 06:17:27 -04:00
|
|
|
|
|
|
|
|
|
|
|
class AP_DCM_HIL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Constructors
|
|
|
|
AP_DCM_HIL() :
|
|
|
|
_dcm_matrix(1, 0, 0,
|
|
|
|
0, 1, 0,
|
|
|
|
0, 0, 1)
|
|
|
|
{}
|
|
|
|
|
|
|
|
// Accessors
|
|
|
|
Vector3f get_gyro(void) {return _omega_integ_corr; }
|
|
|
|
Vector3f get_accel(void) { return _accel_vector; }
|
|
|
|
Matrix3f get_dcm_matrix(void) {return _dcm_matrix; }
|
2010-12-14 14:39:02 -04:00
|
|
|
Matrix3f get_dcm_transposed(void) {Matrix3f temp = _dcm_matrix; return temp.transpose();}
|
2011-07-30 17:34:23 -03:00
|
|
|
|
2010-12-10 06:17:27 -04:00
|
|
|
void set_centripetal(bool b) {}
|
|
|
|
void set_compass(Compass *compass) {}
|
|
|
|
|
|
|
|
// Methods
|
2011-09-15 00:04:08 -03:00
|
|
|
void update_DCM(void) {}
|
2011-09-17 00:42:13 -03:00
|
|
|
void update_DCM_fast(void) {}
|
2010-12-10 06:17:27 -04:00
|
|
|
|
|
|
|
float get_health(void) { return 1.0; }
|
|
|
|
|
|
|
|
long roll_sensor; // Degrees * 100
|
|
|
|
long pitch_sensor; // Degrees * 100
|
|
|
|
long yaw_sensor; // Degrees * 100
|
|
|
|
|
|
|
|
float roll; // Radians
|
|
|
|
float pitch; // Radians
|
|
|
|
float yaw; // Radians
|
|
|
|
|
|
|
|
uint8_t gyro_sat_count;
|
2012-02-17 01:15:27 -04:00
|
|
|
uint8_t renorm_range_count;
|
2010-12-10 06:17:27 -04:00
|
|
|
uint8_t renorm_blowup_count;
|
|
|
|
|
2011-07-30 17:34:23 -03:00
|
|
|
|
|
|
|
float kp_roll_pitch() { return 0; }
|
|
|
|
void kp_roll_pitch(float v) { }
|
|
|
|
|
|
|
|
float ki_roll_pitch() { return 0; }
|
|
|
|
void ki_roll_pitch(float v) { }
|
|
|
|
|
|
|
|
float kp_yaw() { return 0; }
|
|
|
|
void kp_yaw(float v) { }
|
|
|
|
|
|
|
|
float ki_yaw() { return 0; }
|
|
|
|
void ki_yaw(float v) { }
|
|
|
|
|
|
|
|
|
2010-12-10 06:17:27 -04:00
|
|
|
void setHil(float roll, float pitch, float yaw,
|
|
|
|
float rollRate, float pitchRate, float yawRate);
|
|
|
|
private:
|
|
|
|
// Methods
|
2011-07-30 17:34:23 -03:00
|
|
|
Matrix3f _dcm_matrix;
|
2010-12-10 06:17:27 -04:00
|
|
|
Vector3f _omega_integ_corr;
|
|
|
|
Vector3f _accel_vector;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|