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
@@ -439,6 +439,7 @@ void Ekf::fuseOptFlow()
}
}
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][0] * P[0][column];