Skip to content

Commit 40ed9f6

Browse files
rishabsingh3003tridge
authored andcommitted
AP_NavEKF3: correct the scope of posErr
1 parent d6bda73 commit 40ed9f6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,6 @@ void NavEKF3_core::FuseVelPosNED()
699699
// so we might as well take advantage of the computational efficiencies
700700
// associated with sequential fusion
701701
if (fuseVelData || fusePosData || fuseHgtData) {
702-
// calculate additional error in GPS position caused by manoeuvring
703-
ftype posErr = frontend->gpsPosVarAccScale * accNavMag;
704-
705-
// To-Do: this posErr should come from external nav when fusing external nav position
706-
707702
// estimate the GPS Velocity, GPS horiz position and height measurement variances.
708703
// Use different errors if operating without external aiding using an assumed position or velocity of zero
709704
if (PV_AidingMode == AID_NONE) {
@@ -742,6 +737,8 @@ void NavEKF3_core::FuseVelPosNED()
742737
R_OBS[3] = sq(constrain_ftype(extNavDataDelayed.posErr, 0.01f, 10.0f));
743738
#endif
744739
} else {
740+
// calculate additional error in GPS position caused by manoeuvring
741+
const ftype posErr = frontend->gpsPosVarAccScale * accNavMag;
745742
R_OBS[3] = sq(constrain_ftype(frontend->_gpsHorizPosNoise, 0.1f, 10.0f)) + sq(posErr);
746743
}
747744
R_OBS[4] = R_OBS[3];

0 commit comments

Comments
 (0)