Commit Graph

79 Commits

Author SHA1 Message Date
Randy Mackay 5891c6ace8 AP_NavEKF3: separate GPS yaw from ExtNav yaw 2021-01-05 10:58:06 +11:00
Peter Barker 6dfd2f2ff9 AP_NavEKF3: use use_EKFGSFYaw to reduce code duplication 2020-12-17 16:00:29 +09:00
Randy Mackay a2cca60beb AP_NavEKF3: constify EKFGSF_getYaw 2020-12-16 19:18:29 +11:00
Randy Mackay 0c3fcfd9d6 AP_NavEKF3: add missing break to case statements 2020-12-16 19:18:29 +11:00
Paul Riseborough 908b348c31 AP_NavEKF3: Fix typo in enum label 2020-12-15 19:29:16 +11:00
Randy Mackay e819dbdd64 AP_NavEKF3: add EKFGSF_getYaw to reduce duplicate code 2020-12-15 19:29:16 +11:00
Randy Mackay c2edae905f AP_NavEKF3: simplify logic when updating yawAngDataStatic 2020-12-15 19:29:16 +11:00
Randy Mackay 843ddb4fdc AP_NavEKF3: minor format fix 2020-12-15 19:29:16 +11:00
Paul Riseborough a9e76d44af AP_NavEKF3: Clean up yaw fusion logic 2020-12-15 19:29:16 +11:00
Paul Riseborough ccfd89240b AP_NavEKF3: Fix error in calculation of static 312 order yaw reference 2020-12-15 19:29:16 +11:00
Peter Barker 0529ddcd67 AP_NavEKF3: move badMagYaw onto stack 2020-12-01 10:40:09 +11:00
Andrew Tridgell 36c946113d AP_NavEKF3: handle compass fallback in yaw source reset
if we get to this point we must be using the compass fallback logic,
and should do the reset
2020-11-20 16:43:44 +09:00
Randy Mackay 33b6212cce AP_NavEKF3: rename _sources to sources 2020-11-20 16:43:44 +09:00
Randy Mackay faed58a027 AP_NavEKF3: integrate Source for yaw 2020-11-20 16:43:44 +09:00
Paul Riseborough aaf558f593 AP_NavEKF3: Add velocity innovation check to use of EKF-GSF yaw
Only apply to non fly forward vehicle, eg copters, because magnitude of velocity innovation produced by plane launches is TBD.
2020-11-16 16:01:13 +11:00
Andrew Tridgell 9b81c5a1e0 AP_NavEKF3: use dal reference in EKF backends
saves a bit of flash space
2020-11-10 16:15:45 +11:00
Andrew Tridgell 096aab9388 AP_NavEKF3: convert to use AP_DAL for new replay structure
Co-authored-by: Peter Barker <pbarker@barker.dropbear.id.au>
2020-11-10 16:15:45 +11:00
Randy Mackay 2681d3afe2 AP_NavEKF3: simplify alignYawAngle 2020-11-03 11:00:01 +11:00
Paul Riseborough 16ae75a681 AP_NavEKF3: Consolidate and log tilt error variance calculation 2020-10-26 11:03:50 +11:00
Paul Riseborough 69632336e1 AP_NavEKF3: Remove singularity in yaw fusion at +-90deg yaw
Uses sympy derivation
2020-10-26 11:03:50 +11:00
Paul Riseborough 4e41e9f5f1 AP_NavEKF3: Ensure consistent use of 312 or 321 rotation order
Prevents possibility of a differnt sequence being used to calculate the yaw and application of the yaw to the quaternions
2020-10-26 11:03:50 +11:00
Paul Riseborough 73d5ca5ad3 AP_NavEKF3: Fix yaw drift after yaw reset at +-90 deg pitch
Use existing covariance prediction code to set quaternion state covariances.
Assumes tilt error is 3 deg 1-sigma.
TODO derive and add function that calculates tilt error variance.
2020-10-26 11:03:50 +11:00
Paul Riseborough 0b96f046c2 AP_NavEKF3: Unblock initial yaw alignment message 2020-10-26 11:03:50 +11:00
Peter Barker 0496ecc4f6 AP_NavEKF2: remove unused state variables 2020-10-22 08:47:08 +11:00
Peter Barker 83d784c22d AP_NavEKF3: fix includes 2020-10-20 11:40:54 +11:00
Andrew Tridgell c03c43e52c AP_NavEKF3: use same mag switch pattern as EKF2
based on Pauls suggested change
2020-09-08 11:01:14 +10:00
Andrew Tridgell 458ade86f5 AP_NavEKF3: fixed segfault when IMU mask covers more IMUs than GSF mask 2020-08-28 10:17:00 +10:00
chobits 7ad9e3548f AP_NavEKF3: make reset source variable local 2020-08-10 09:43:28 +09:00
Peter Barker 6b701ae3b3 AP_NavEKF3: correct includes 2020-08-07 19:20:07 +10:00
Paul Riseborough c8bbbd2720 AP_NavEKF3: Fix bug preventing setting of mag field states 2020-07-25 20:46:04 +10:00
Paul Riseborough 9a4108f55e AP_NavEKF3: Simplify setting EK3_MAG_CAL
Don't require user to separately set EK3_MAG_CAL to fly without a magnetomer
2020-07-07 15:33:58 +10:00
Paul Riseborough 0dc598a6e1 AP_NavEKF3: Fix param description and comment 2020-07-07 15:33:58 +10:00
Paul Riseborough 21ea5d5039 AP_NavEKF3: Require GSF yaw history for reset when not using a yaw sensor 2020-07-07 15:33:58 +10:00
Paul Riseborough f86c2e1db6 AP_NavEKF3: Don't fuse EKF-GSF yaw for FW flight 2020-07-07 15:33:58 +10:00
Paul Riseborough b469a80633 AP_NavEKF3: Reset all co-variances when performing a yaw reset 2020-07-07 15:33:58 +10:00
Paul Riseborough d8c2096ad8 AP_NavEKF3: improve angle accuracy during no mag launch 2020-07-07 15:33:58 +10:00
Peter Barker bf3cb977fd AP_NavEKF3: clarify yaw reset error message
The current wording can be taken to indicate that the mag sensors
stopped, causing this issue.
2020-05-26 10:05:35 +10:00
Paul Riseborough 939331ae8d AP_NavEKF3: Fix double iteration of axes in SelectMagFusion 2020-05-18 09:38:45 +10:00
Andrew Tridgell cd5aae20c1 AP_NavEKF3: fixed scary message for non-compass planes 2020-05-09 12:33:33 +10:00
Andrew Tridgell 0c1ba48212 AP_NavEKF3: fixed external yaw EK3_MAG_CAL=5 or 6
don't use GSF
2020-05-04 15:05:56 +10:00
priseborough c5e465aec9 AP_NavEKF3: add external nav system support
includes decoupling height source from use of external nav data
2020-04-30 15:55:59 +09:00
Andrew Tridgell 080f555b16 AP_NavEKF3: remove unused isDeltaYaw param from resetQuatStateYawOnly 2020-04-24 09:43:23 +10:00
Andrew Tridgell 197d31e9cc AP_NavEKF3: fixed in-flight yaw reset 2020-04-24 09:43:23 +10:00
Randy Mackay c1ef894a30 AP_NavEKF3: getDataEKFGSF and getYawData pass by reference 2020-04-24 09:43:23 +10:00
Randy Mackay 8a8271c2c7 AP_NavEKF3: minor format fixes 2020-04-24 09:43:23 +10:00
Paul Riseborough 12d639fc17 AP_NavEKF3: Misc changes arising from review
AP_NavEKF3: Fix typo in comment

AP_NavEKF3: Use uint32_t data type for msec timers

AP_NavEKF3: Misc msec timer fixes

Fix wrapping bug.
Use common timestamp.

AP_NavEKF3: Format fixes - remove tabs

AP_NavEKF3: Fix typing and wrap issue on time comparison
2020-04-24 09:43:23 +10:00
Paul Riseborough 863f989130 AP_NavEKF3: Fix integration of GPS yaw options
AP_NavEKF3: fix failure to arm with EK3_MAG_CAL = 7

AP_NavEKF3: Fix failure to arm when not using magnetometer

AP_NavEKF3: Reduce yaw drift when EK3_MAG_CAL = 7
2020-04-24 09:43:22 +10:00
Paul Riseborough 410b5825fb AP_NavEKF3: Enable use of EKF-GSF yaw estimate
AP_NavEKF3: Add emergency yaw reset using a Gussian Sum Filter estimate

AP_NavEKF3: Reduce default minimum GPS velocity noise for Copters

Enables fail-safe to be set with more sensitivity and improves tracking accuracy.
Origin values were set using typical GPS performance for receivers on sale 6 years ago. Receiver performance has improved since then.

AP_NavEKF3: Prevent constant mag anomaly yaw resets

Prevents constant magnetic anomaly induced resets that can be triggered when flying with vehicle generated magnetic interference.
Allows for two resets per takeoff. Allowance for two resets is required, becasue a large ground based magnetic yaw anomaly can cause a sufficiently large yaw innovation that two resets in close succession are required.

AP_NavEKF3: Add option to fly without magnetometer

AP_NavEKF3: Rework emergency yaw reset logic

Use a separate external accessor function to request the yaw reset.
Allow reset requests to remain active for a defined period of time.
Tidy up reset function to split out accuracy check.

AP_NavEKF3: Fix vulnerability to lane switch race condition

Prevents the situation where a lane switch results in a lane being selected that does not have the correct yaw. This can occur if the primary lane becomes unhealthy before the external failsafe monitor has time to react.

AP_NavEKF3: Fix EKF_MAG_CAL = 6 behaviours

Fix bug causing the yaw alignment to be performed at startup before the GSF had a valid estimate.
Fix bug causing emergency yaw message to be output for a normal reset.
Fix vulnerability to reported negative yaw variance.
Remove duplicate timer checks.

AP_NavEKF3: Update EK3_MAG_CAL documentation

AP_NavEKF3: Relax yaw gyro bias convergence check when not using mag

AP_NavEKF3: Reduce yaw drift in hover with no yaw sensor

Uses the GSF yaw estimate if available which is better than the EKF's own yaw when no yaw sensor is available.
2020-04-24 09:43:22 +10:00
Paul Riseborough f68f355852 AP_NavEKF3: Fix timestamp wrapping 2020-04-11 21:14:31 +10:00
Paul Riseborough 33ab1a7b15 AP_NavEKF3: Ensure yaw fusion commences when starting from rest 2020-04-11 21:14:31 +10:00