forked from Archive/PX4-Autopilot
position_estimator_inav: hotfix, change lower dt limit from 5 ms to 2 ms
This commit is contained in:
parent
501dc0cfa7
commit
647142764f
|
@ -15,10 +15,7 @@ void inertial_filter_predict(float dt, float x[3])
|
|||
|
||||
void inertial_filter_correct(float e, float dt, float x[3], int i, float w)
|
||||
{
|
||||
float ewdt = w * dt;
|
||||
if (ewdt > 1.0f)
|
||||
ewdt = 1.0f; // prevent over-correcting
|
||||
ewdt *= e;
|
||||
float ewdt = e * w * dt;
|
||||
x[i] += ewdt;
|
||||
|
||||
if (i == 0) {
|
||||
|
|
|
@ -623,7 +623,7 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
float dt = t_prev > 0 ? (t - t_prev) / 1000000.0f : 0.0f;
|
||||
dt = fmaxf(fminf(0.02, dt), 0.005);
|
||||
dt = fmaxf(fminf(0.02, dt), 0.002); // constrain dt from 2 to 20 ms
|
||||
t_prev = t;
|
||||
|
||||
/* use GPS if it's valid and reference position initialized */
|
||||
|
|
Loading…
Reference in New Issue