When the EKF is not fusing in observations from the NE global reference frame, the tolerance to yaw errors is much higher. This changes will prevent false triggering of the preflight fail check when operating indoors without GPS where mag field errors can be high.
Before that, different modules (ekf2, commander & land detector) changed
params upon different events:
- ekf2 & commander set params after disarm
- land detector set params on land detected
If the 2 events were several 100ms appart, it led to 2 param saves, and
the latter param set could have been blocked by an ongoing save. And if
the land detector was blocked, it could lead to mag timeouts.
This patch makes all modules use the same event, thus only a single param
save will happen.
If we want to have guarantees to never block, we should introduce a
param_try_set() API method.
_should_stop_file_log is set after disarming: logging continues for 1s
to measure the CPU usage.
During that time, other modules might change params (such as ekf), and
we don't need to have these the log. However currently all modules do
not notify the system when setting params after disarming.
Meaning this patch is not strictly needed, it's more a preventive
measure.
This branch fixes a reported bug, fixes tow potential bugs and fixes a minor documentation error.
1) Removes code un-used under normal conditions that would prevent a height reset if a negative height variance was present. Potential bug.
2) Fix error in parameter documentation.
3) Adds missing initialisations for class variables . Potential bug.
4) Prevents the EKF loss of navigation message being output on startup. Reported bug.
This check is performed for up to 30 seconds after takeoff or until a horizontal speed of 5 m/s has been achieved.
If the vehicle is not landed and the check is active, then the yaw will be declared as failed if the velocity innovations fail for a continuous period of 1 second.
This will cause the local and global position and velocity validity to be latched false to prevent unsafe use of position control modes.
Fix the bug allowing arming without GPS checks passed in the first 20 seconds after gaining GPS lock when COM_ARM_WO_GPS is set to 0
Allow 10 seconds after boot for EKF quality checks to pass before reporting failure to allow EKF to stabilise.
Move GPS quality checking and reporting to after all innovation and bias checks.
Make messages more informative.
Add missing GPS speed accuracy check.
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.
Separate the vertical and horizontal checks for use by local position validity reporting
Add checking of yaw using a decaying envelope filter to the horizontal checks.
Publish the check result to estimator_status topic.