- do not gps reference altitude to zero in case gps checks pass before the
filter initialized
- reset the filtered gps position and position derivative filters in case
we are in air or there is movement on the ground
Signed-off-by: RomanBapst <bapstroman@gmail.com>
* Support vision velocity expressed in body frame
* Use switch statement for vision velocity frame
* Robustify vision velocity frame test
* Increase lower bound on vision velocity noise to 0.05 m/s
* EKF: Enable GPS flight without magnetometer
Enables takeoff in a non-GPS flight mode with mag fusion type set to MAG_FUSE_TYPE_NONE. After sufficient movement the EKF will reset the yaw tot he EKF-GSF estimate. After that GPS fusion will commence.
* EKF: Fix unconstrained yaw and yaw variance growth when on ground
* EKF: Ensure first yaw alignment can't be blocked
* EKF: Increase yaw variance limit allowed for alignment
Flight test data indicates that an uncertainty value of 15 deg still provides a reliable yaw estimate and enables an earlier alignment/reset if required.
* EKF: Remove unexecutable code
* EKF: Restructure heading fusion
* EKF: parameterise quarter variance check and retune default value
* EKF: Pass by reference instead of pointer
* EKF: Clarify reset logic
* EKF: Remove incorrect setting of mag field alignment flag
* EKF: Non-functional tidy up
* EKF: Fix non-use of function argument
The updateQuaternion function was using the _heading_innovation class variable instead of setting it using the innovation argument.
* EKF: Fix undefined variable
* EKF: Use single precision atan2
* EKF: remove unnecessary timer reset and unwanted execution of reset function
* EKF: Don't declare a mag fault when non-use is user selected
Doing so produces unnecessary user alerts.
Fusion with large initial magnetometer biases errors can result in the the NE earth field states reducing in magnitude and effectively flipping sign.
EKF: Move declination state limiting into a separate function
EKF: Limit NE mag states after each 3-axis mag fusion
EKF: Fix bug in mag field strength look-up scale factor
When starting aiding using EV only and commencing GPS aiding later, this change means that the GPS origin is set to the local position 0,0 point rather than the current vehicle position. This avoids large changes in local position when GPs aiding starts.
Doing so can casue large jumps in GPS position and innovation check errors after landing and also reduces the effectiveness of pre-flight innovation consistency checks.
Previously GPS quality checks were only run until the EKF origin was set. This meant that they could not be used by other pre-flight checks.
This change ensures that checks will always be run when the vehicle on-ground or not using GPS to enable use by external preflight checks.