Выполняется корректное чтение данных иму. Оси и наклоны соответствуют рабочим прошивке и дрону

This commit is contained in:
2026-04-06 16:13:16 +03:00
parent 699577d82b
commit b713794a26
8 changed files with 100 additions and 84 deletions

View File

@@ -27,19 +27,17 @@ void IRS_update(IRS* irs, float dt)
irs->q = QuatSum(&irs->q, &g);
irs->q = QuatNormalize(&irs->q, 1.0f);
// /gyro update
// /gyro update
// accel update
Vector3 accel = {irs->accel.x, irs->accel.y, irs->accel.z};
restoreQuat(irs, &accel);
restoreQuat(irs);
// /accel update
}
void restoreQuat(IRS* irs, const Vector3* accel)
void restoreQuat(IRS* irs)
{
float len = lengthV3(accel);
float len = lengthV3(&irs->accel);
static float quat_acc_alpha = 0.03f;
static float quat_acc_max = 0.02f;
@@ -51,7 +49,7 @@ void restoreQuat(IRS* irs, const Vector3* accel)
if (gain < 0.0001f) return;
Vector3 acc = normalizeV3(accel, 1.0f);
Vector3 acc = normalizeV3(&irs->accel, 1.0f);
Vector3 est = IRS_getGravity(&irs->q);