The commander checks use instantaneous values which are vulnerable to false negatives or positives with noisy data or transient faults.
This patch checks the estimators published pre flight check status which is based on persistent checks using filtered data.
In day to day practice, there are two reasons for fabsf(airspeed.differential_pressure_filtered_pa) > 15.0f
1/ The sensor has not been calibrated. In this case, the sensor needs to be calibrated.
2/ It's a windy day, and the operator has powered up the system without covering the pitot tube. In that case, you need to reboot with the pitot cover in place.
The original message ('Check calibration') is ok, but why not be more direct? The user does not have to "check the calibration" - the user has to (a) either calibrate the system in the first place, or (b) not forget the pitot tube cover when powering up the system.
The previous approach would work with old low-end sensors, but with new high-end sensors we get a lot of false alarms on the bench. Relaxing the check to only apply pre-arm will ensure its now only run when the user intents to take off, at which point the airframe should be with pitot covers off in the field.
Move into functions.
Reset probation time and recalculate checks if a mode change is demanded to give the operator ability to regain control as soon as possible after nav performance is regained. (+11 squashed commits)
Squashed commits:
[a4bb800] commander: enable pilot to quickly recover from loss of position accuracy
[19e16a0] commander: rework postal probation time
[f96284e] commander: rework bad pos and vel test probation time
[00d5f0c] commander: Allow EKF preflight checks to pass with moving vehicle
Separates the 'is using GPS' and the GPS quality checks.
Uses a reasonable subset of the GPS quality checks which allows checks to pass if the vehicle is moving.
[4cdfb5c] commander: remove unused variable
[349385a] commander: add EKF GPS quality checks to pre-arm checking
Only perform check if GPs checking is activated by parameter setting.
Display fault messages that makes it clear if EKF quality checks are failing or the EKF is not using GPS for another reason. We do not want to confuse this with GPS lock.
[340ae29] commander: make position invalid fail-safe more sticky
Require check to pass for 7 seconds before exiting failsafe. This is required because if GPs is failing innovation tests for a prolonged period, the EKF will periodically reset to the GPS and report good accuracy at the time of reset.
Adding this delay gives time for an underlying error condition (eg bad IMU or compass) to be re-detected.
[b04ac95] commander: Increase RAM allocation to eliminate low stack warnings
[9dca12f] commander: add missing position invalid fail-safe responses
[69f264d] commander: Update position invalid fail-safe responses
Replace separate logic for each case with a generic function
Add velocity checks.
[8e8cef1] commander: rework position validity checks
Consolidate existing checks for global and local position validity and add checking of velocity accuracy.
Enable checks to be bypassed using the CBRK_VELPOSERR parameter.
* Loosen thresholds for gyro consistency check until temperature compensated units are the norm
* Cut down string lengths so they make it through the MAVLink transport as a whole
I am unable to get the nuttx build dependencies set up so that
it builds the export dir before it builds df_driver_framework.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>