-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed althold issue in surface mode for multirotors #10314
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -150,7 +150,7 @@ void estimationCalculateAGL(estimationContext_t * ctx) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
const float accWeight = navGetAccelerometerWeight(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
posEstimator.est.aglAlt += posEstimator.est.aglVel * ctx->dt; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
posEstimator.est.aglAlt += posEstimator.imu.accelNEU.z * sq(ctx->dt) / 2.0f * accWeight; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
posEstimator.est.aglVel += posEstimator.imu.accelNEU.z * ctx->dt * sq(accWeight); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels wrong to me. In AGL mode, the sensor that measures distance to ground should have higher gains than accelerometer. This feels like it was done like this on purpose. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me explain. inav/src/main/navigation/navigation_pos_estimator.c Lines 483 to 509 in e64753b
Originally, its value was fixed and there was a setting for that. Therefore, the weight was squared for vel estimations. But when they changed the way the accelerometer weight works, forgot to update this file. Now the problem is that the accWeight can go down to 0.3 automatically and squared is 0.3*0.3=0.09 which is too low. Some rangefinders like the one in the mtf-01 is too slow taking measurements which makes the navigation very unstable.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
posEstimator.est.aglVel += posEstimator.imu.accelNEU.z * ctx->dt * accWeight; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Apply correction | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (posEstimator.est.aglQual == SURFACE_QUAL_HIGH) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is changing behavior when not in surface mode.