Browse Source

AP_NavEKF2: Update protection for out of focus flow data

mission-4.1.18
priseborough 8 years ago committed by Randy Mackay
parent
commit
a75a383ef2
  1. 6
      libraries/AP_NavEKF2/AP_NavEKF2_OptFlowFusion.cpp

6
libraries/AP_NavEKF2/AP_NavEKF2_OptFlowFusion.cpp

@ -43,8 +43,10 @@ void NavEKF2_core::SelectFlowFusion() @@ -43,8 +43,10 @@ void NavEKF2_core::SelectFlowFusion()
gndOffsetValid = ((imuSampleTime_ms - gndHgtValidTime_ms) < 5000);
// Perform tilt check
bool tiltOK = (prevTnb.c.z > frontend->DCM33FlowMin);
// Constrain measurements to zero if we are on the ground
if (frontend->_fusionModeGPS == 3 && !takeOffDetected) {
// Constrain measurements to zero if takeoff is not detected and the height above ground
// is insuffient to achieve acceptable focus. This allows the vehicle to be picked up
// and carried to test optical flow operation
if (!takeOffDetected && ((terrainState - stateStruct.position.z) < 0.5f)) {
ofDataDelayed.flowRadXYcomp.zero();
ofDataDelayed.flowRadXY.zero();
flowDataValid = true;

Loading…
Cancel
Save