mherb / kalman

Header-only C++11 Kalman Filtering Library (EKF, UKF) based on Eigen3
MIT License
1.33k stars 383 forks source link

Not force-symmetrizing covariance after measurement update step #37

Open jsvacha opened 2 years ago

jsvacha commented 2 years ago

The P -= K H P step should possibly cause numerical issues that result in an asymmetric and non-positive-definite covariance matrix, right? Shouldn't the covariance matrix be re-symmetrized after that step with P = 0.5 * (P + P^T)? May not be a big deal unless we're dealing with UKF but the thought of the covariance matrix becoming non-positive-definite scares me.