ArduPilot / ArduPilot/ardupilot
EKF: FLOW_DELAY parameter values should be defaulted by sensor
- Dominant language
- C++
- Stars
- 15.9k
- Forks
- 21.4k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 119
Description
We have begun supporting new lower cost optical flow sensors like the [Cheerson CX-OF](http://ardupilot.org/copter/docs/common-cheerson-cxof.html).
The EK2_FLOW_DELAY parameter is 10 by default which works for the PX4Flow sensor which has a very high update rate (100hz?) but for the Cheerson CX-OF (with an update rate of 25hz) the value must be 80. The issue appears to be that if the delay value is too low the EKF will (for some reason) not consume the flow data. This is actually quite dangerous as the EKF's velocity estimate becomes very bad and the vehicle may fly off in any direction if switched to Loiter (or another autonomous mode)
The optical flow sensors should provide an estimated delay which the EKF can then use if the user hasn't specifically change the EK2_FLOW_DELAY parameter... or possibly the delay parameter should be moved out of the EKF completely and become an optical flow sensor parameter? The GPS drivers do something similar so perhaps we should follow the existing pattern.
This all applies to the EKF3 as well.
As a side note I find it odd that the sensor lag parameter is related to the sensor's update rate. The two concepts are quite separate. A sensor could have a 100hz update rate but a lag/delay of 1 second. I think this is related to the EKF only maintaining a single value from the sensor instead of a small buffer of values. This means that if the delay doesn't match the update rate sensor values are lost somehow.
Contributor guide
Research direction
Start by examining the EKF2_FLOW_DELAY and EKF3 flow-delay handling, then compare the existing GPS driver pattern mentioned in the issue. Determine how optical-flow sensors expose update or delay information and define how sensor defaults should interact with user-set parameters. Done means both EKF2 and EKF3 use appropriate sensor-specific defaults without losing valid flow data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- robotics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100