30 lines
645 B
C
30 lines
645 B
C
#ifndef IRS_H
|
|
#define IRS_H
|
|
|
|
#include "quaternion.h"
|
|
#include "vector.h"
|
|
|
|
#define PI 3.14159265359f
|
|
#define DEG2RAD PI / 180.0f
|
|
|
|
typedef struct
|
|
{
|
|
Quaternion q; // ориентация
|
|
Vector3 oriPRT; // orientation pitch roll tilts
|
|
Vector3 gyro; // deg/s
|
|
Vector3 accel; // g
|
|
|
|
Quaternion shiftAccelPRY; // смещение акселерометра
|
|
|
|
} IRS;
|
|
|
|
void IRS_init(IRS* irs);
|
|
|
|
void IRS_update(IRS* irs, float dt);
|
|
void restoreQuat(IRS* irs, const Vector3* accel);
|
|
|
|
void setAccelShift(IRS* irs, const float pitch, const float roll, const float yaw);
|
|
|
|
Vector3 IRS_getGravity(const Quaternion* q);
|
|
|
|
#endif |