Commit Graph

667 Commits

Author SHA1 Message Date
Andrew Tridgell b36bfe4206 AP_NavEKF2: fixed init order for scheduler
this can impact replay of EKF2
2021-01-02 10:30:26 +11:00
Paul Riseborough b372d62f35 AP_NavEKF2: Add accessor function for body frame airspeed vector 2020-12-11 15:21:41 +11:00
Andrew Tridgell 5e72907730 AP_NavEKF2: only fuse airspeed if healthy 2020-12-11 09:59:49 +11:00
Peter Barker f6d3983e1b AP_NavEKF2: move EKF2 message ids into AP_NavEKF2 2020-12-08 11:30:10 +11:00
Peter Barker 00ac8391c0 AP_NavEKF2: move EKF2 logging structures into EKF2 LogStructure.h 2020-12-08 11:30:10 +11:00
Peter Barker c5c810b724 AP_NavEKF2: use structures for logging GSF data
This makes it look like EKF2 and is marginally more efficient.
2020-12-02 10:30:48 +11:00
Peter Barker f94f51d9d3 AP_NavEKF2: move log message metadata to be above the structure
This is the pattern we are adopting elsewhere to try to keep things
related as much as possible.
2020-12-02 10:30:48 +11:00
Peter Barker d600b87454 AP_NavEKF2: make logging a core concern 2020-12-01 13:06:04 +11:00
Peter Barker fc7e7dcee4 AP_NavEKF2: remove unused variables 2020-12-01 10:40:09 +11:00
Peter Barker addd57dcab AP_NavEKF2: move badMagYaw onto stack 2020-12-01 10:40:09 +11:00
Peter Barker 0aa10d8281 AP_NavEKF2: move tasHealth to be a stack variable 2020-12-01 10:40:09 +11:00
Peter Barker 3a98d51427 AP_NavEKF2: move posvel fusion health booleans to be on the stack 2020-12-01 10:40:09 +11:00
Peter Barker 400ba7a9df AP_NavEKF2: move global state to be on the stack 2020-12-01 10:40:09 +11:00
Andrew Tridgell 7313e9eb0f AP_NavEKF2: removed inhibitGps and inhibitGpsVertVel options
these were unused
2020-12-01 10:33:50 +11:00
Andrew Tridgell 79148498d3 AP_NavEKF2: don't reset EKx_GPS_TYPE when GPS has no vertical velocity
setting the parameter to 1 causes the following issues:

 - the GPS may not have vertical velocity at the time the parameter
   set happens, but may get it later when the GPS is fully configured

 - we may switch between GPS modules which do/don't have vertical
   velocity

 - the user may download parameters after the set(1), and end up with
   incorrect parameters they may later load onto the vehicle,
   permanently disabling use of vertical velocity
2020-12-01 10:33:50 +11:00
Randy Mackay 4087d7b792 AP_NavEKF2: add configuredToUseGPSForPosXY 2020-11-25 21:00:07 +11:00
Andrew Tridgell 39ba8a8c83 AP_NavEKF2: convert to using common buffer classes
this saves a considerable amount of flash
2020-11-20 21:56:32 +11:00
Andrew Tridgell 3a4095fc7f AP_NavEKF2: use common structure names 2020-11-17 13:45:07 +11:00
Paul Riseborough 248ef92ed7 AP_NavEKF2: 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
Paul Riseborough e5e8d0ba3c AP_NavEKF2: Don't update yaw estimator with bad GPS 2020-11-16 16:01:13 +11:00
Andrew Tridgell a2f4b16cdc AP_NavEKF2: fixed logged core for GSF messages 2020-11-16 10:28:43 +11:00
Andrew Tridgell 01cd678244 AP_NavEKF2: fixed memory corruption on push before init
this fixes a bug that happens with VISION_SPEED_ESTIMATE from a
companion computer, which may come in before the EKF buffers are
allocated. That causes a push to an uninitialised ringbuffer which
triggers memory corruption

found using the new memory guard system
2020-11-15 15:42:48 +11:00
Andrew Tridgell 7099bb6096 AP_NavEKF2: fixed gcc 9.3 build error
gcc 9.3 doesn't like the use of get_accel(i) when array length is 1
2020-11-13 14:30:11 +11:00
Andrew Tridgell 5b41d5541f AP_NavEKF2: removed use of another lanes gyro in optflow takeoff detection
as discussed with Paul
2020-11-10 16:15:45 +11:00
Andrew Tridgell 7d7031d3d7 AP_NavEKF2: added const (review request) 2020-11-10 16:15:45 +11:00
Andrew Tridgell 16f7e51ea5 AP_NavEKF2: fixed use of pointers in ringbuffers
these don't work with AP_DAL
2020-11-10 16:15:45 +11:00
Andrew Tridgell 246a441883 AP_NavEKF2: cope with INS_MAX_INSTANCES below 3 2020-11-10 16:15:45 +11:00
Andrew Tridgell 5f0e943f0f AP_NavEKF2: use dal reference in EKF backends
saves a bit of flash space
2020-11-10 16:15:45 +11:00
Andrew Tridgell 8591b31665 AP_NavEKF2: cleanup unused code 2020-11-10 16:15:45 +11:00
Andrew Tridgell bec095d661 AP_NavEKF2: support replay with external navigation data 2020-11-10 16:15:45 +11:00
Andrew Tridgell 224792b8b8 AP_NavEKF2: added optflow support for AP_DAL 2020-11-10 16:15:45 +11:00
Andrew Tridgell 90a8c5cb1a AP_NavEKF2: use ekf_low_time_remaining for core scheduling 2020-11-10 16:15:45 +11:00
Andrew Tridgell f3c3778169 prevent duplicate EKF logging
vehicle code sometimes tries to log the same data twice
2020-11-10 16:15:45 +11:00
Andrew Tridgell 6be3d19e82 AP_NavEKF2: 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
Peter Barker 84c92b717f AP_NavEKF2: make coreBetterScore const 2020-11-03 10:39:35 +11:00
Randy Mackay fccc1fcb72 AP_NavEKF2: minor comment fix 2020-10-28 12:17:22 +09:00
Andrew Tridgell dc32f7a12f AP_NavEKF2: fixed multi-core yaw reset
thanks to Alex Burka for finding this
2020-10-24 19:35:30 +11:00
Peter Barker 0496ecc4f6 AP_NavEKF2: remove unused state variables 2020-10-22 08:47:08 +11:00
Peter Barker 53305ba2a4 AP_NavEKF2: remove unused quat2Tbn method 2020-10-20 11:40:54 +11:00
Peter Barker 312cf725aa AP_NavEKF2: remove dangling method declarations 2020-10-20 11:40:54 +11:00
Peter Barker c90265f94d AP_NavEKF2: fix includes 2020-10-20 11:40:54 +11:00
Peter Barker 80f9ef7ed1 AP_NavEKF2: remove unused innovationIncrement and lastInnovation 2020-10-20 11:24:34 +11:00
Randy Mackay b2d4622320 AP_NavEKF2: replace prearm_healthy with pre_arm_check 2020-10-07 11:53:07 +11:00
Andrew Tridgell 35e95d3328 AP_NavEKF2: reset body mag variances at key points
reset on sensor switch or when changing to 3D fusion
2020-09-20 09:25:57 +10:00
Andrew Tridgell 534e63e2fa AP_NavEKF2: fixed init of earth state mag variances
we were starting with zero variance for X and Y earth states, it
should start with sq(magNoise)
2020-09-20 09:25:57 +10:00
Andrew Tridgell d6dcbda0d3 AP_NavEKF2: removed duplicate compass switch check
left over from last set of changes
2020-09-20 09:25:57 +10:00
Andrew Tridgell 067001bd61 AP_NavEKF2: take into account alignment when comparing cores
ensure we don't switch to a lane that does not have yaw or tilt
alignment from a lane that is aligned
2020-09-14 20:29:04 +10:00
Paul Riseborough da7bb44a61 AP_NavEKF2: Consolidate magnetometer timeout checks 2020-09-08 11:01:14 +10:00
Andrew Tridgell 6b9e595602 AP_NavEKF2: 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
Andrew Tridgell 6ee527d3e0 AP_NavEKF2: fixed segfault when IMU mask covers more IMUs than GSF mask 2020-08-28 10:17:00 +10:00