EKF: remove Ekf::KHP and move KHP to the methods where it's used

Everywhere where KHP is used, it is first completely reset, thus making
it unnecessary to keep it as a class member.

This saves 2.3KB RAM.

Stack sizes don't need changing, since there is already a function
Ekf::predictCovariance(), which needs around 3KB of stack and is called
close to where the fuse* functions are called.
This commit is contained in:
Beat Küng
2016-11-01 22:49:20 +01:00
committed by Lorenz Meier
parent 227938d263
commit 25cb400da9
5 changed files with 6 additions and 1 deletions
+1
View File
@@ -169,6 +169,7 @@ void Ekf::fuseAirspeed()
KH[row][23] = Kfusion[row] * H_TAS[23];
}
float KHP[_k_num_states][_k_num_states];
for (unsigned row = 0; row < _k_num_states; row++) {
for (unsigned column = 0; column < _k_num_states; column++) {
float tmp = KH[row][4] * P[4][column];