Выполняется корректное чтение данных иму. Оси и наклоны соответствуют рабочим прошивке и дрону
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user