EKF: move calculation of optical flow observation variance into a function

Allows it to be used when calculating initial state variance
This commit is contained in:
Paul Riseborough
2016-05-08 15:40:06 +10:00
parent 25682dce91
commit 724280fd1f
3 changed files with 31 additions and 19 deletions
+2 -2
View File
@@ -106,8 +106,8 @@ void Ekf::controlFusionModes()
zeroRows(P,4,5);
zeroCols(P,4,5);
// reset the horizontal velocity variance using the optical flow noise
P[5][5] = P[4][4] = sq(range * _params.flow_noise_qual_min);
// reset the horizontal velocity variance using the optical flow noise variance
P[5][5] = P[4][4] = sq(range) * calcOptFlowMeasVar();
if (!_in_air) {
// we are likely starting OF for the first time so reset the position and states