ekf2_test: test using positive definite covariance matrix

A covariance matrix needs to be positive definite
This commit is contained in:
bresch
2022-10-19 17:34:31 +02:00
committed by Mathieu Bresciani
parent 10f9ac148f
commit 42f683fa64
3 changed files with 7 additions and 3 deletions
@@ -40,6 +40,7 @@ float randf()
SquareMatrix24f createRandomCovarianceMatrix24f()
{
// Create a symmetric square matrix
SquareMatrix24f P;
for (int col = 0; col <= 23; col++) {
@@ -53,6 +54,9 @@ SquareMatrix24f createRandomCovarianceMatrix24f()
}
}
// Make it positive definite
P = P.transpose() * P;
return P;
}