mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 08:23:34 +08:00
EKF2: Error-State Kalman Filter (#22262)
* ekf derivation: change to error state formulation * ekf2: update auto-generated code for error-state * ekf2: adjust ekf2 code for error state formulation * ekf2_tests: adjust unit tests for error-state EKF * update change indicator for error-state EKF * ekf2_derivation: allow disabling mag and wind states --------- Co-authored-by: bresch <[brescianimathieu@gmail.com](mailto:brescianimathieu@gmail.com)>
This commit is contained in:
co-authored by
bresch
parent
d7f388e590
commit
0d6c2c8ce9
@@ -43,7 +43,6 @@
|
||||
|
||||
#include "ekf.h"
|
||||
#include <ekf_derivation/generated/predict_covariance.h>
|
||||
#include <ekf_derivation/generated/rot_var_ned_to_lower_triangular_quat_cov.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <mathlib/mathlib.h>
|
||||
@@ -368,10 +367,8 @@ void Ekf::resetQuatCov(const float yaw_noise)
|
||||
|
||||
void Ekf::resetQuatCov(const Vector3f &rot_var_ned)
|
||||
{
|
||||
matrix::SquareMatrix<float, State::quat_nominal.dof> q_cov;
|
||||
sym::RotVarNedToLowerTriangularQuatCov(_state.vector(), rot_var_ned, &q_cov);
|
||||
q_cov.copyLowerToUpperTriangle();
|
||||
resetStateCovariance<State::quat_nominal>(q_cov);
|
||||
matrix::SquareMatrix<float, State::quat_nominal.dof> q_cov_ned = diag(rot_var_ned);
|
||||
resetStateCovariance<State::quat_nominal>(_R_to_earth.T() * q_cov_ned * _R_to_earth);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_EKF2_MAGNETOMETER)
|
||||
|
||||
Reference in New Issue
Block a user