Обновлена архитектура обработки IMU

This commit is contained in:
2026-03-23 14:11:50 +03:00
parent 8e69ab9cdc
commit 49f45bd4fe
5 changed files with 187 additions and 309 deletions

View File

@@ -1,40 +1,24 @@
#pragma once
#ifndef IRS_H
#define IRS_H
#include "quaternion.h"
#include "vector.h"
#define PI 3.14159265359f
#define DEG2RAD PI / 180.0f
typedef struct
{
Quaternion orientationQ; // главный кватерион ориентации
// Vector3 tilts; // локально ориентированные наклоны sinX sinY cosZ
Vector3 gyro, accel; // последние значения датчиков
float roll, pitch, yaw;
Quaternion q; // ориентация
Vector3 gyro; // deg/s
Vector3 accel; // g
// Vector3 accel, spd, pos; // инерциальные значения движения
} IRS;
void updateIRS(IRS* irs, const Vector3* gyro, const Vector3* accel, float dt);
void IRSgetEuler(const IRS* irs);
void IRS_init(IRS* irs);
void updateGyro(Vector3* gyro, const Vector3* newGyro);
void updateAccel(Vector3* accel, const Vector3* newAccel);
void IRS_update(IRS* irs, const Vector3* gyro, const Vector3* accel, float dt);
// 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();
Vector3 IRS_getGravity(const IRS* irs);
#endif