Browse Source

AP_NavEKF2: Ensure that GPS origin is set before using data for height

master
Paul Riseborough 9 years ago committed by Andrew Tridgell
parent
commit
97799ef0b3
  1. 2
      libraries/AP_NavEKF2/AP_NavEKF2_PosVelFusion.cpp

2
libraries/AP_NavEKF2/AP_NavEKF2_PosVelFusion.cpp

@ -545,7 +545,7 @@ void NavEKF2_core::selectHeightForFusion() @@ -545,7 +545,7 @@ void NavEKF2_core::selectHeightForFusion()
// determine if we should be using a height source other than baro
bool usingRangeForHgt = (frontend->_altSource == 1 && imuSampleTime_ms - rngValidMeaTime_ms < 500 && frontend->_fusionModeGPS == 3);
bool usingGpsForHgt = (frontend->_altSource == 2 && imuSampleTime_ms - lastTimeGpsReceived_ms < 500);
bool usingGpsForHgt = (frontend->_altSource == 2 && imuSampleTime_ms - lastTimeGpsReceived_ms < 500 && validOrigin);
// if there is new baro data to fuse, calculate filterred baro data required by other processes
if (baroDataToFuse) {

Loading…
Cancel
Save