Commit Graph

108 Commits

Author SHA1 Message Date
Andrew Tridgell f5275fd0ad AP_NavEKF3: fixed use of pointers in ringbuffers
these don't work with AP_DAL
2020-11-10 16:15:45 +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 1bdf6173ec AP_NavEKF3: removed have_ekf_logging 2020-11-10 16:15:45 +11:00
Andrew Tridgell a0de6c620f AP_NavEKF3: use selected GPS for gps_yaw_deg()
more than one GPS could provide yaw
2020-11-10 16:15:45 +11:00
Andrew Tridgell e87f98066f AP_NavEKF3: support replay with external navigation data 2020-11-10 16:15:45 +11:00
Andrew Tridgell 7bbbbd314c AP_NavEKF3: added optflow support for AP_DAL 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 2f1ae29a9c AP_NavEKF3: extnav data gets corrected boolean
CorrectExtNavForSensorOffset and CorrectExtNavVelForSensorOffset use
corrected boolean to avoid correcting twice
2020-10-24 12:35:58 +11:00
Randy Mackay 71487e9c10 AP_NavEKF3: gps_elements gets corrected flag
CorrectGPSForAntennaOffset uses this flag to ensure position and velocity are only corrected once
2020-10-24 08:49:33 +09:00
Andrew Tridgell 8a4b0f858a AP_NavEKF3: reset body mag variances at key points
we need to reset the body mag variances if we change sensors or if we
are starting 3D fusion. When not doing 3D fusion we zero the
variances, so they must be initialised again when we restart
fusion. This fixes a bug in handling the variances on a 2nd flight
2020-09-20 09:25:57 +10: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 3836b59041 AP_NavEKF3: fixed handling of failed compass
when a compass goes unhealthy due to sensor failure we should try
another compass after 10s if another compass is available
2020-09-08 11:01:14 +10:00
Harshit Kumar Sankhla edc3709653 AP_NavEKF3: implement sensor affinity using EK3_AFFINITY parameter
this allows the EKF core index to be used to select a GPS/baro/mag
instance. This is an alternative to GPS blending that allows EKF lane
switching to be used to select the right combination of GPS and IMU
add logging to XKFS message
2020-08-27 20:20:51 +10:00
Randy Mackay 46a7e96c48 AP_NavEKF3: readRngBcnData avoids array overflow from beacon count 2020-08-25 09:38:10 +09:00
Randy Mackay b86e16e927 AP_NavEKF3: readRngBcnData gets minor formatting fix 2020-08-25 09:38:10 +09:00
Randy Mackay 384029d278 AP_NavEKF3: rngBcnDataNew made local 2020-08-25 09:38:10 +09:00
Randy Mackay 8c877f02af AP_NavEKF3: shrink beacon arrays and add assert 2020-08-25 09:38:10 +09:00
Randy Mackay 6bf2057712 AP_NavEKF3: minor formatting fixes 2020-08-21 13:18:58 +09:00
Randy Mackay 4c40d2ac3f AP_NavEKF3: readyToUseBodyOdm uses delayed imu and wheel encoder timestamps 2020-08-21 13:18:58 +09:00
Randy Mackay 056a2de260 AP_NavEKF3: wheelOdmDataNew member made local
this variable is never used outside the writeWheelOdom method
2020-08-21 13:18:58 +09:00
Andrew Tridgell 44d5a923cc AP_NavEKF3: apply min GPS accuracy at measurement point
this fixes an issue a RTK GPS gives 1cm horizontal and vertical
accuracy and that causes the variances to get too small
2020-08-21 07:40:13 +10:00
chobits c722367c6c AP_NavEKF3: move extNavVelNew to local variable 2020-08-12 15:40:38 +09:00
Peter Barker 6b701ae3b3 AP_NavEKF3: correct includes 2020-08-07 19:20:07 +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 8ff6780323 AP_NavEKF3: Clarify distinct use cases for 'takeoff expected' 2020-07-07 15:33:58 +10:00
Paul Riseborough d1a0c2eb30 AP_NavEKF3: Start EKF-GSF yaw estimator before fixed wing takeoff 2020-07-07 15:33:58 +10:00
Dr.-Ing. Amilcar do Carmo Lucas fca8d33c50 AP_NavEKF3: fix vertical flyaways when rangefinder stops providing data 2020-06-24 21:16:50 +09:00
Randy Mackay ca0ae57b56 AP_NavEKF3: protect against position-delta sensor data being NaN 2020-06-19 13:46:52 +09:00
Randy Mackay 331f2f5fe7 AP_NavEKF3: writeExtNavData stores pos to buffer first
This is a non-functional change
2020-06-19 13:46:52 +09:00
Randy Mackay 578800dfbb AP_NavEKF3: protect against ExtNav being NaN 2020-06-19 13:46:52 +09:00
chobits 9b448b83c0 AP_NavEKF3: use err info from ext nav interface 2020-06-09 13:31:21 +09:00
Randy Mackay 0f212ca727 AP_NavEKF3: accept extnav at up to 50hz 2020-06-09 09:42:14 +10:00
chobits c7817eaca1 AP_NavEKF3: support VISION_SPEED_ESTIMATE
Co-authored-by: Randy Mackay <rmackay9@yahoo.com>
2020-06-02 08:33:42 +09:00
Randy Mackay ef02942459 AP_NavEKF3: writeBodyFrameOdom accepts delay 2020-05-15 10:07:52 +09:00
Randy Mackay c28fd27b02 AP_NavEKF3: writeExtNavData accepts delay 2020-05-15 10:07:52 +09:00
Randy Mackay 45e6896d95 AP_NavEKF3: ensure extnav angle error is at least 5deg 2020-05-14 08:02:13 +10:00
Andrew Tridgell 5350ea5c58 AP_NavEKF3: avoid build warnings with g++ 9 2020-05-10 15:11:22 +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
Paul Riseborough ad5ae1813d AP_NavEKF3: Don't use geomag data when user specifies declination 2020-04-28 11:42:31 +09:00
Andrew Tridgell 216935c1f2 AP_NavEKF3: fixed loss of GPS fusion
we must not do a storedGPS.recall unless we will be using the data,
otherwise we will lose GPS samples and risk stopping GPS fusion
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
Peter Barker 87108b86c8 AP_NavEKF3: add documentation for XKFM message 2020-04-21 09:48:43 +10:00
Andrew Tridgell 1f8cd830ea AP_NavEKF3: fixed use of tabs 2020-04-11 21:14:31 +10:00
Paul Riseborough eeac0a05b9 AP_NavEKF3: Improvements to on ground movement check
Reduce sensitivity and log test ratios.
Reduce base logging rate to 5Hz and log when status changes.
2020-04-11 21:14:31 +10:00
Paul Riseborough ebb8bb4f6f AP_NavEKF3: Enable use of yaw fusion before external yaw sensor starts 2020-04-11 21:14:31 +10:00
Andrew Tridgell 6f04fae4a0 AP_NavEKF3: added fallback to mag option with external yaw
this allows for a magnetometer to be used as a fallback yaw source in
flight when using an external yaw source such as a GPS. The
magnetometer bias is learned while the GPS yaw is available and
fallback is only done if the mag yaw and GPS yaw are consistent when
fallback is enabled

This also learns the Z gyro bias until first yaw alignment when
MAG_CAL is EXTERNAL_YAW_FALLBACK. This prevents large gyro bias
building while waiting for GPS lock
2020-04-11 21:14:31 +10:00
Peter Barker 4c19eb4bab AP_NavEKF3: use compass reference rather than repeatedly asking AHRS for it 2020-03-13 08:26:18 +11:00
Peter Barker 4431d01230 AP_NavEKF3: stop relying on the presence of a RangeFinder 2019-12-11 08:09:01 +11:00
Andrew Tridgell c6aad9b1ec AP_NavEKF3: don't use WMM tables unless we have a compass scale factor set 2019-12-03 20:48:23 +11:00