Skip to content

Commit d44f2cf

Browse files
Merge pull request #11255 from sensei-hacker/fix/agl-velocity-weight-squared
Fix AGL velocity estimation using squared acceleration weight factor
2 parents c8df08c + 5cf56e8 commit d44f2cf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/navigation/navigation_pos_estimator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static bool gravityCalibrationComplete(void)
354354
static void updateIMUEstimationWeight(const float dt)
355355
{
356356
static float acc_clip_factor = 1.0f;
357-
// If accelerometer measurement is clipped - drop the acc weight to 0.3
357+
// If accelerometer measurement is clipped - drop the acc weight to 0.5
358358
// and gradually restore weight back to 1.0 over time
359359
if (accIsClipped()) {
360360
acc_clip_factor = 0.5f;

src/main/navigation/navigation_pos_estimator_agl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void estimationCalculateAGL(estimationContext_t * ctx)
149149
// Update estimate
150150
posEstimator.est.aglAlt += posEstimator.est.aglVel * ctx->dt;
151151
posEstimator.est.aglAlt += posEstimator.imu.accelNEU.z * sq(ctx->dt) / 2.0f * posEstimator.imu.accWeightFactor;
152-
posEstimator.est.aglVel += posEstimator.imu.accelNEU.z * ctx->dt * sq(posEstimator.imu.accWeightFactor);
152+
posEstimator.est.aglVel += posEstimator.imu.accelNEU.z * ctx->dt * posEstimator.imu.accWeightFactor;
153153

154154
// Apply correction
155155
if (posEstimator.est.aglQual == SURFACE_QUAL_HIGH) {

0 commit comments

Comments
 (0)