Commit Graph

152 Commits

Author SHA1 Message Date
Randy Mackay
6850b48ea1 AP_NavEKF3: add comments for yaw sensor variables 2021-01-05 10:58:06 +11:00
Randy Mackay
a2cca60beb AP_NavEKF3: constify EKFGSF_getYaw 2020-12-16 19:18:29 +11:00
Randy Mackay
9cb529cfd6 AP_NavEKF3: minor formatting fix
also replace tab with spaces
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
Paul Riseborough
a9e76d44af AP_NavEKF3: Clean up yaw fusion logic 2020-12-15 19:29:16 +11:00
Paul Riseborough
8f32430294 AP_NavEKF3: Fix white spaces 2020-12-11 15:21:41 +11:00
Paul Riseborough
4884476c09 AP_NavEKF3: Formatting and comment fixes 2020-12-11 15:21:41 +11:00
Paul Riseborough
c9ab4b18b0 AP_NavEKF3: Add multicopter wind estimation 2020-12-11 15:21:41 +11:00
Andrew Tridgell
bdba430e55 AP_NavEKF3: save memory on beacon debug structure
only allocate when beacons are enabled. This relies on a guarantee in
the DAL that the beacon count cannot change
2020-12-01 10:53:08 +11:00
Peter Barker
e972fb31b1 AP_NavEKF3: remove unused variables 2020-12-01 10:40:09 +11:00
Peter Barker
0529ddcd67 AP_NavEKF3: move badMagYaw onto stack 2020-12-01 10:40:09 +11:00
Peter Barker
2885026bba AP_NavEKF3: move tasHealth to be a stack variable 2020-12-01 10:40:09 +11:00
Peter Barker
b79a26135c AP_NavEKF3: move posvel fusion health booleans to be on the stack 2020-12-01 10:40:09 +11:00
Peter Barker
2d25149e2e AP_NavEKF3: move global state to be on the stack 2020-12-01 10:40:09 +11:00
Andrew Tridgell
d242339f2e AP_NavEKF3: added have_vz flag to GPS buffer data
this ensures that we record GPS vertical velocity status for every
sample correctly
2020-12-01 10:33:50 +11:00
Andrew Tridgell
80f7906744 AP_NavEKF3: removed inhibitGps and inhibitGpsVertVel options
these were unused
2020-12-01 10:33:50 +11:00
Peter Barker
e1a033b296 AP_NavEKF3: make logging a core concern
Also dissolve some methods only used for logging
2020-11-22 20:47:29 +11:00
Andrew Tridgell
1e4b1d7563 AP_NavEKF3: convert to using common buffer classes
this saves a considerable amount of flash
2020-11-20 21:56:32 +11:00
Randy Mackay
5eb3875ebb AP_NavEKF3: rename posxy_source_last and posxy_source_reset 2020-11-20 16:43:44 +09:00
Randy Mackay
9716b09cad AP_NavEKF3: minor indenting fix 2020-11-20 16:43:44 +09:00
Randy Mackay
6c0bb6a198 AP_NavEKF3: add convert_params for source 2020-11-20 16:43:44 +09:00
Randy Mackay
ba9f60abc7 AP_NavEKF3: add getVelInnovationsAndVariancesForSource 2020-11-20 16:43:44 +09:00
Randy Mackay
58aa6086df AP_NavEKF3: always calculate GPS innovations and variances 2020-11-20 16:43:44 +09:00
Randy Mackay
e7e91b1c3b AP_NavEKF3: always calculate extNav innovations and variances 2020-11-20 16:43:44 +09:00
Randy Mackay
6b2b5c4ca0 AP_NavEKF3: add CalculateVelInnovationsAndVariances 2020-11-20 16:43:44 +09:00
Randy Mackay
4cadaa5194 AP_NavEKF3: readyToUseOptFlow, Beacon, ExtNav check source 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
Randy Mackay
8931e50166 AP_NavEKF3: integrate Source for alt 2020-11-20 16:43:44 +09:00
Randy Mackay
c21d58ebea AP_NavEKF3: integrate Source for position 2020-11-20 16:43:44 +09:00
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
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
Paul Riseborough
6c7820dd8d AP_NavEKF3: Add verification of tiltErrorVariance() method in SITL 2020-10-26 11:03:50 +11:00
Paul Riseborough
16ae75a681 AP_NavEKF3: Consolidate and log tilt error variance calculation 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
a97d030e4b AP_NavEKF3: Reset earth field variances when starting mag field estimation 2020-10-26 11:03:50 +11:00
Randy Mackay
c3fd82b6d7 AP_NavEKF3: minor spelling fix 2020-10-24 12:35:58 +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
Peter Barker
0496ecc4f6 AP_NavEKF2: remove unused state variables 2020-10-22 08:47:08 +11:00
Peter Barker
ef505df78a AP_NavEKF3: remove unused quat2Tbn method 2020-10-20 11:40:54 +11:00
Peter Barker
0eafe4b662 AP_NavEKF3: remove dangling method declarations 2020-10-20 11:40:54 +11:00
Peter Barker
3dc67f09fd AP_NavEKF3: remove unused innovationIncrement and lastInnovation 2020-10-20 11:24:34 +11: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
e9185f526b AP_NavEKF3: add comments on state indexes
make it easier to check indexes
2020-09-20 09:25:57 +10:00
Andrew Tridgell
2bc7d17e7a AP_NavEKF3: improved core comparison to check alignment
this adds coreBetterScore() which takes account of tilt and yaw
alignment when comparing cores for lane switching

this ensures we don't switch to a lane that is unaligned due to the
zero error score for unaligned lanes
2020-09-14 20:29:04 +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