Skip to content

fix(ekf2): allow optical flow to start when range finder is height reference#26960

Merged
dakejahl merged 1 commit intomainfrom
dakejahl/fix-flow-range-height
Apr 2, 2026
Merged

fix(ekf2): allow optical flow to start when range finder is height reference#26960
dakejahl merged 1 commit intomainfrom
dakejahl/fix-flow-range-height

Conversation

@dakejahl
Copy link
Copy Markdown
Contributor

@dakejahl dakejahl commented Apr 2, 2026

Summary

  • When EKF2_HGT_REF=2 (range sensor) with no GPS, optical flow can never start because the starting condition requires isTerrainEstimateValid() || isHorizontalAidingActive() — neither is true since terrain is not "estimated" when range is the height reference (ground is the datum, _state.terrain is fixed at 0), and there's no horizontal aiding without GPS
  • HAGL is directly known from the range measurement, so flow has everything it needs — add _height_sensor_ref == HeightSensor::RANGE to the starting conditions, consistent with the check already present in the no-horizontal-aiding start path at line 206

Fixes #25248
Fixes #26911

…ference

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: #25248
@dakejahl dakejahl merged commit 9b6e7cb into main Apr 2, 2026
79 checks passed
@dakejahl dakejahl deleted the dakejahl/fix-flow-range-height branch April 2, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] ARK Flow Optical Flow Doesn't Function on 1.16.0 [Bug] MTF-01 OpticalFlow Local Position Estimation doesn't work well on 1.16

2 participants