Paul Riseborough
44c50ab2df
EKF: Correct magnetic yaw measurement using learned mag biases
...
Don't apply bias corrections when biases are being learned to avoid possible circular data dependency.
7 years ago
Paul Riseborough
29d383edbf
EKF: Allow mag field estimates to stabilise before use
7 years ago
Paul Riseborough
6f7f05fdc0
EKF: Move MAG_FUSE_TYPE_AUTOFW control to the expected place
7 years ago
Paul Riseborough
e834522f62
EKF: Use fixed wing status flag in MAG_FUSE_TYPE_AUTOFW logic
7 years ago
Paul Riseborough
7b4c957ad4
ekf2: Add new mag fusion mode
...
Adds a mode where mag fusion is only used update the field estimates
7 years ago
Daniel Agar
99ba1c3745
EKF trivial code style cleanup
8 years ago
Paul Riseborough
35ffd55481
EKF: Fix incorrect use of double precision operation
8 years ago
Paul Riseborough
20584ee997
EKF: Improve efficiency of heading fusion calculations when using EV heading
...
Moves calculation only required for mag heading fusion into the if (_control_status.flags.mag_hdg) branch
When using EV yaw, the observed yaw angle is calculated directly from the EV quaternions using derived expressions from references in code comments.
8 years ago
Daniel Agar
c44488fdb8
EKF matrix typedef cleanup
8 years ago
Julien Lecoeur
d0b4f1e225
Use binary operator~ instead of logical operator!
8 years ago
Julien Lecoeur
c323b64742
Fix -Werror=int-in-bool-context on GCC 7
8 years ago
CarlOlsson
be16406b35
EKF: Add feature to use the mag to only update the mag states
8 years ago
Beat Küng
07c6aabd98
EKF: reduce KH to only the elements that are really needed, and merge the loops
8 years ago
Paul Riseborough
1b59a89a18
EKF: save some stack memory
8 years ago
Beat Küng
25cb400da9
EKF: remove Ekf::KHP and move KHP to the methods where it's used
...
Everywhere where KHP is used, it is first completely reset, thus making
it unnecessary to keep it as a class member.
This saves 2.3KB RAM.
Stack sizes don't need changing, since there is already a function
Ekf::predictCovariance(), which needs around 3KB of stack and is called
close to where the fuse* functions are called.
8 years ago
Paul Riseborough
79b1d3018d
EKF: Fix magnetometer innovation test ratio reporting bug
8 years ago
Paul Riseborough
a2d866520a
EKF: perform innovation check in all axes before fusing 3D mag data ( #171 )
...
Perform the innovation consistency check on all axes first and exit if any axis fails. Reduces the likelihood of bad magnetometer data corrupting the attitude estimates.
9 years ago
Paul Riseborough
b3baab64f2
EKF: Updates to 3-axis mag fusion auto-code
...
The code fragments for the magnetometer fusion have been refreshed from the auto-coder.
Explicit floating point types used for constants.
The 3x24 observation Jacobian has been replaced with a 1x24 that is updated each axis iteration to save memory.
9 years ago
Paul Riseborough
21168f9929
EKF: fix bug in 3-axis mag fusion innovation test
...
The fault flag was not being set after an innovation test failure resulting in fusion of the failed measurement
9 years ago
Paul Riseborough
99b34f0df4
EKF: Only reset necessary terms when mag fusion covariance reset required
...
Only the quaternion and mag fusion state covariances are used in the mag fusion calculations.
9 years ago
Paul Riseborough
381d99aed6
EKF: Inform console of serious fusion numerical errors
9 years ago
Paul Riseborough
dbfe8c0242
EKF: remove approximation in mag fusion innovation variance calculation
...
The covariance was not being updated with the observation from one axis before the innovation variance was calculated for the next axis. This results in greater weighting on measurements for subsequent axes.
9 years ago
Paul Riseborough
65da9173b9
EKF: capture innovation checks and reset events in separate variables
...
rename the innovation check status class variable and remove the reset flags from it.
9 years ago
Paul Riseborough
388e500180
EKF: remove un-used magnetometer health class variable
...
replaced by _sensor_health_status
9 years ago
Paul Riseborough
e7690bd8f8
EKF: capture magnetometer innovation test failures
9 years ago
Paul Riseborough
3fb449295e
EKF: capture yaw innovation test failures
9 years ago
Carl Olsson
0fafc49a49
fixed typos ( #147 )
9 years ago
Paul Riseborough
920d83d68c
EKF: Fix bugs preventing use of external vision yaw data
9 years ago
Paul Riseborough
59eb9eb3db
EKF: fix shadow declaration arising from rebase
9 years ago
Paul Riseborough
e917d6c7f2
EKF: Add fusion of external yaw data
9 years ago
Paul Riseborough
020b87933e
EKF: replace fault status struct with a union to facilitate logging
9 years ago
Paul Riseborough
7f5669fb2d
EKF: consolidate covariance corrections
...
Combines the forced symmetry, variance limiting and zeroing of covariances for unwanted states in the one function.
This ensures a consistent correction is applied after every covariance prediction or correction.
9 years ago
Paul Riseborough
c8d95586e7
EKF: Improve protection against bad magnetometer fusion
9 years ago
Paul Riseborough
f01f4ae4b1
EKF: tidy up mag declination fusion
9 years ago
Paul Riseborough
0d31aad33a
EKF: Fix bad limit on magnetometer noise parameter
9 years ago
Paul Riseborough
7069fb7a04
EKF: refresh auto code for mag fusion
9 years ago
Paul Riseborough
a373ada858
EKF: explicitly define floating point type in hardcoded constants
9 years ago
Paul Riseborough
82da832816
EKF: tidy up Kalman gain calculations
...
Inhibiting of states is controlled via zeroing rows and columns in the covariance prediction so conditional logic in gain calculations is unnecessary.
9 years ago
Paul Riseborough
fe9f88a8b4
EKF: test new derivation
...
Use direct attitude parameterisation
Discard scale factors
Add accel bias
9 years ago
Paul Riseborough
5bf02517a7
EKF: Rationalise use of rotation matrices and improve efficiency
9 years ago
Paul Riseborough
6b2e2dba90
EKF: Add GPS height option and improve height recovery
9 years ago
Paul Riseborough
5242af84af
EKF: Standardise covariance update and use static arrays for large matrices
9 years ago
Paul Riseborough
1414d591ce
EKF: Fix bug in declination fusion indexing
9 years ago
Paul Riseborough
a6da73fa83
EKF: Add missing div0 protection
9 years ago
Paul Riseborough
97df006a6a
EKF: Update direct heading fusion
...
Adds a 312 Euler rotation sequence option for magnetic heading fusion.
Switches between it and the normal 321 sequence option depending on orientation.
9 years ago
Paul Riseborough
0ad5329caf
EKF: Update comments in heading fusion to clarify calculation of magnetic heading
9 years ago
Paul Riseborough
a711632017
EKF: Add method to fuse horizontal magnetometer data
...
This method is more suitable than a raw heading measurement because it works across a full range of pitch angles.
It has been made the default for ground operation.
9 years ago
Paul Riseborough
6df6ac0023
EKF: Fix sign error in heading innovation calculation and clean up
9 years ago
Paul Riseborough
90e1bd3e36
EKF: wrap compass yaw estimate
9 years ago
Paul Riseborough
7d6226eb45
EKF: Improve efficiency of yaw angle fusion
...
Use direct calculation of Kaman gains with optimised algebra
9 years ago