mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-11 11:53:33 +08:00
When EKF2_HGT_REF=2 (range sensor) with no GPS, optical flow could never start. The starting condition required isTerrainEstimateValid() or isHorizontalAidingActive(), but terrain is never "estimated" when range is the height reference (ground is the datum, terrain state is fixed at 0), and there's no horizontal aiding without GPS. HAGL is directly known from the range measurement in this case, so optical flow has everything it needs to fuse. Add the range height reference check to the optical flow starting conditions. Fixes: https://github.com/PX4/PX4-Autopilot/issues/25248