mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 15:57:35 +08:00
EKF: Fix bug causing slow drift when high rate flow data is used
High rate optical flow data could make flow fusion to run every major update cycle, resulting in the calculation of bias errors in the body rates used to compensate flow data failing time validity checks and not running. This resulted in a slow drift of the nav solution if bias errors were present in the in the gyro data used for flow sensor motion compensation.
This commit is contained in:
committed by
Lorenz Meier
parent
ee2dc7d790
commit
d177e96508
@@ -43,6 +43,7 @@
|
|||||||
#include "ekf.h"
|
#include "ekf.h"
|
||||||
#include <ecl.h>
|
#include <ecl.h>
|
||||||
#include <mathlib/mathlib.h>
|
#include <mathlib/mathlib.h>
|
||||||
|
#include <cfloat>
|
||||||
|
|
||||||
void Ekf::fuseOptFlow()
|
void Ekf::fuseOptFlow()
|
||||||
{
|
{
|
||||||
@@ -538,7 +539,7 @@ void Ekf::calcOptFlowBias()
|
|||||||
|
|
||||||
// if accumulation time differences are not excessive and accumulation time is adequate
|
// if accumulation time differences are not excessive and accumulation time is adequate
|
||||||
// compare the optical flow and and navigation rate data and calculate a bias error
|
// compare the optical flow and and navigation rate data and calculate a bias error
|
||||||
if ((fabsf(_delta_time_of - _flow_sample_delayed.dt) < 0.1f) && (_delta_time_of > 0.01f)) {
|
if ((fabsf(_delta_time_of - _flow_sample_delayed.dt) < 0.1f) && (_delta_time_of > FLT_EPSILON)) {
|
||||||
// calculate a reference angular rate
|
// calculate a reference angular rate
|
||||||
Vector3f reference_body_rate;
|
Vector3f reference_body_rate;
|
||||||
reference_body_rate = _imu_del_ang_of * (1.0f / _delta_time_of);
|
reference_body_rate = _imu_del_ang_of * (1.0f / _delta_time_of);
|
||||||
|
|||||||
Reference in New Issue
Block a user