40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
#pragma once
|
|
|
|
#ifndef IRS_H
|
|
#define IRS_H
|
|
|
|
#include "quaternion.h"
|
|
#include "vector.h"
|
|
|
|
typedef struct
|
|
{
|
|
Quaternion orientationQ; // главный кватерион ориентации
|
|
// Vector3 tilts; // локально ориентированные наклоны sinX sinY cosZ
|
|
|
|
Vector3 gyro, accel; // последние значения датчиков
|
|
|
|
float roll, pitch, yaw;
|
|
|
|
// Vector3 accel, spd, pos; // инерциальные значения движения
|
|
} IRS;
|
|
|
|
void updateIRS(IRS* irs, const Vector3* gyro, const Vector3* accel, float dt);
|
|
void IRSgetEuler(const IRS* irs);
|
|
|
|
void updateGyro(Vector3* gyro, const Vector3* newGyro);
|
|
void updateAccel(Vector3* accel, const Vector3* newAccel);
|
|
|
|
// void setShiftAlpha(const Vector3* pos, const Vector3* spd, const float* qua); // коэффициент восстановления позиции и скорости в секунду
|
|
|
|
// void updatePosSpeed();
|
|
void updateQuat();
|
|
|
|
// void restoreAllShift();
|
|
|
|
// void setAccelShift();
|
|
|
|
// void getSinXYCosZ();
|
|
// void getRollPitchYaw();
|
|
// void getInertial();
|
|
|
|
#endif |