If magnetometer use is being inhibited because an indoor condition has been detected (optical flow and poor or no GPS) and the optical flow fusion checks fail causing the EKF to stop navigating, we do not want the EKF to start using the magnetometer.
Remove duplicate checking for dead reckoning and consolidate into a single function.
Use separate timers to check for start of dead reckoning and check when dead reckoning has been performed for too long for the nav solution to be valid.
Allow the timeout for validity reporting to be adjusted externally.
Separate external reporting of dead reckoning from internal checks.
* EKF: Move optical flow specific state reset to helper functions
* EKF: Ensure loss of optical flow aiding is handled correctly
If data is only source of aiding and has been rejected for too long - reset using flow data as a velocity reference.
If flow data is unavailable for too long - declare optical flow use stopped.
Use consistent time periods for all resets
* EKF: Ensure loss of external vision aiding is handled correctly
If data is only source of aiding and has been rejected for too long - reset using data as a position.
Don't reset velocity if there is another source of aiding constraining it.
If data is unavailable for too long, declare external vision use stopped.
Use consistent time periods for all resets.
* EKF: Update parameter documentation
Make the distinction between the no_gps_timeout_max and no_aid_timeout_max parameters clearer
* EKF: make class variable units consistent with documentation
* EKF: Don't reset states when optical flow use commences if using external vision
* EKF: Stop optical flow fusion when on ground if excessive movement is detected.
* EKF: fix terrain estimator vulnerabilities
Reset estimate to sensor value if rejected for 10 seconds
Protect against user motion when on ground.
Fix unnecessary duplication of terrain validity check and separate validity update and reporting.
* EKF: remove unnecessary Info console prints
Optical flow use information can be obtained from the estimator_status.control_mode_flags message
* EKF: fix inaccurate comment
* EKF: remove duplicate calculation from terrain validity accessor function
* EKF: Do not delay reversion to no-aiding mode if parameter initiated
* EKF: Move no-aid reversion resets to helper functions
* EKF: Prevent unwanted fusion of velocity data during no aiding mode
* Revert "EKF: Release flow speed limit with altitude gained"
This reverts commit e70206f74b.
* Revert "fix code style"
This reverts commit 76bf70121c.
* Revert "Reverse the linked list of data_validator_group and maintain a first node"
This reverts commit 32482e7644.
* fix typo
* EKF: use baro if it was reset to baro from ev
* EKF: set vert_pos_reset if resetting to ev hgt
otherwise the position controller will not reset the setpoint -> leading to unwanted altitude changes
Gate size class variables should not be initialised to zero, because it will cause a /0 error if fuseVelPosHeight() is called before they are set to their respective parameter values.
When GPS use is gained whilst flying using optical flow data, the sudden release of the speed limit is unannounced to the operator and can cause unexpected acceleration.
This patch releases the speed limit as height is gained, but does not reduce it when the vehicle descends, unless GPS use is lost.
This enables the EKF to use an additional NE velocity measurement. This can be used to improve position hold stability when landing using a beacon system for positioning by fusing the beacon velocity estimates.
Apply a dead-zone to the vertical position innovation if using baro for height and if in the ground effect region during and just after takeoff.
Method needs to be activated externally.
Turns off automatically after 10 seconds or if specified height gained.
When magnetic field states have been reset in-flight using a single sample, the magnetic field states are not used to constrain heading drift for a period after the reset. This period has been shortened from 10 to 5 seconds which is enough time to average out the effects of measurement noise (the original concern). The shorter time has enabled the previous practice for RW vehicles of using magnetic heading in that time period to constrain yaw drift to be discontinued. This is necessary becasue while magnetic heading is being used, it fights the yaw corrections obtained from GPs observations and lengthens the time required to recover from a bad mag calibration.
If state errors were large before the reset, then failure to reset the covariance matrix terms can result in incorrect fusion of position and velocity measurements after the reset due to inconsistencies in the covariance matrix.
When performing the initial in-flight mag yaw reset for RW vehicle, do not reset the quaternion states and corresponding variances unless there has been a change in yaw angle large enough to cause problems with navigation.
This is because the state estimates after a reset are more vulnerable to transient sensor errors, so a reset should be avoided if possible.
When performing the initial in-flight magnetic field reset for fixed wing vehicles, resetting the quaternion states and their corresponding covariances should be avoided unless yaw errors are large, because state estimates are vulnerable to transient sensor errors immediately following a reset.
Ensures that a complete reset of velocity and position states will always be performed if yaw has had to be reset using GPS velocity.
Ensures that the yaw_align status cannot be set to false once the filter has aligned.
Reduces susceptibility to incorrect estimation of acceleration bias during sustained yaw rate.
Requires an increase in RAM allocation of 837 Bytes to allow for the longer IMU and output predictor buffers that can be created.