Commit Graph

1214 Commits

Author SHA1 Message Date
Julian Oes 14227eaf1d CMakeLists.txt: fix cmake warning
This removes the cmake warning:
  implicitly converting 'string' to 'STRING' type.
2019-04-08 09:54:47 -04:00
Paul Riseborough f97f0b6ea3 EKF: Remove unnecessary code
_flt_mag_align_start_time is set on initial alignment and will always be >0 before this check can run
2019-04-08 06:57:17 +10:00
Paul Riseborough 43b5e26fe4 EKF: Fix bug causing continual yaw reset when EKF2_MAG_TYPE = 2 2019-04-08 06:57:17 +10:00
Roman f95cd4b358 ground effect: removed dependency on local position
Signed-off-by: Roman <bapstroman@gmail.com>
2019-03-19 13:14:57 +11:00
CarlOlsson 7845ff4360 EKF: increase wind process noise scaler to 0.5
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-19 13:10:12 +11:00
CarlOlsson 32ca6f7030 ekf: scale wind process noise with low pass filtered height rate 2019-03-19 13:10:12 +11:00
CarlOlsson 938c8ad9ad EKF: use hagl estimate if valid for when to trigger yaw reset on takeoff 2019-03-19 13:04:54 +11:00
Hamish Willee 8b4ae48c69 README: Fix link to EKF/ECL tuning guide 2019-03-18 10:21:10 -04:00
Carl Olsson f0889c1760 EKF: fixed some comment typos
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-18 10:20:33 -04:00
Todd Stellanova 6e77b197c7 Add DataValidatorGroup tests, add more DataValidator tests (#592) 2019-03-15 00:09:47 -04:00
Daniel Agar a892ececf8 cmake add ECL_TESTS option only enabled in standalone build 2019-03-12 23:29:30 -04:00
Paul Riseborough fabd216ca5 EKF: Documentation edits 2019-03-13 08:14:23 +11:00
CarlOlsson 8d6e8ae078 EKF: update get_mag_decl_deg()
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-13 08:14:23 +11:00
CarlOlsson 2b17ced405 EKF: Clean up use of magnetometer declination. Before the innovation was not zero in fuseDeclination()
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-13 08:14:23 +11:00
CarlOlsson 1d91785a8e EKF: correct quaternion order 2019-03-12 19:07:55 +11:00
CarlOlsson 000aa0de5d EKF: do not update the newest attitude estimate in initialiseFilter(). Is is now done in alignOutputFilter() 2019-03-12 19:07:55 +11:00
CarlOlsson 96c5c14041 EKF: Change the EKF initialization to
1) init tilt
2) init yaw
3) init tilt uncertainty
4) init yaw uncertainty

Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-12 19:07:55 +11:00
CarlOlsson ea259d358d EKF: initialize the newest attitude estimate to a valid quaternion
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-12 19:07:55 +11:00
CarlOlsson 6cf512f103 EKF: Also update the newest and oldest quaternion estimate in
alignOutputFilter()

Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-12 19:07:55 +11:00
CarlOlsson 78122b20a6 EKF: fix the rotation direction of the buffered attitude solutions
in alignOutputFilter()

Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-12 19:07:55 +11:00
CarlOlsson 56b6b7a778 EKF: cleanup use of _mag_filt_state
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-12 19:07:55 +11:00
CarlOlsson 37339de57c EKF: remove unused variable
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-12 19:07:55 +11:00
Todd Stellanova 6c759e0e9f Initial unit tests for DataValidator (#588) 2019-03-09 14:47:13 -05:00
Nuno Marques 4e0e68e905 Ekf: add more useful methods to interface with the covariances (#543) 2019-03-09 11:57:35 -05:00
Daniel Agar a85d3a43ed attitude_fw remove unused 2019-03-05 17:26:19 -05:00
Daniel Agar c66f7f4a09 EKF drop unused timestamp from collect_gps() and pass data by const reference 2019-03-05 17:26:19 -05:00
Freek van Tienen 78b899c72d Add Paparazzi compatibility (#580)
This adds support for the paparazzi autopilot to use this library as EKF.
The header order change has to be done in order to have std.h included to get certain defines at the start of the estimator_interface.h.
2019-03-05 12:41:21 -05:00
Daniel Agar 5cd331055f cmake standalone build pin PX4/Matrix to commit
- 6b0777d815
2019-03-05 12:35:37 -05:00
Daniel Agar 1378ec1797 EKF mag_fusion avoid unnecessary double promotion 2019-02-08 08:24:24 -05:00
Carl Olsson 54ab8191e3 EKF: add method to get the terrain variance 2019-02-06 08:49:16 -05:00
Daniel Agar c5554cae96 EKF tests update SWIG usage and use latest containers 2019-02-03 18:27:00 -05:00
Paul Riseborough dd58e69549 EKF: Ensure FW yaw alignment method is used on first in-air reset 2019-01-31 09:53:57 -05:00
Paul Riseborough 3accab1ac5 EKF: protect declination fusion from badly conditioned earth field estimates
Fusion with large initial magnetometer biases errors can result in the the NE earth field states reducing in magnitude and effectively flipping sign.

EKF: Move declination state limiting into a separate function

EKF: Limit NE mag states after each 3-axis mag fusion

EKF: Fix bug in mag field strength look-up scale factor
2019-01-31 09:53:57 -05:00
Paul Riseborough 7bddbd1cc5 EKF: Update cleaned up autocode fragment with sign error fix and missing LD 2019-01-31 09:53:57 -05:00
Paul Riseborough fe378fd761 EKF: Prevent unwanted declination fusion when re-starting 3-axis fusion 2019-01-31 09:53:57 -05:00
Paul Riseborough bd1647a7fb EKF: Rework use of fuseDeclination()
Simplify calling so that it is only called in two ways:
1) Immediately before 3-axis mag fusion if not called since the last earth field covariance reset so that the earth field declination information can be formed.
2) Immediately after 3-axis mag fusion otherwise.
2019-01-31 09:53:57 -05:00
Paul Riseborough d52f53635b EKF: Save mag field covariance data before reset 2019-01-31 09:53:57 -05:00
Paul Riseborough 82ce7a83a5 EKF: Save mag field covariance information on startup 2019-01-31 09:53:57 -05:00
Paul Riseborough 708c79eb8f EKF: Ensure mag field state covariance data is always available for re-use
Prevents use of  _saved_mag_ef_covmat and _saved_mag_bf_variance before being initialised or when stale.
2019-01-31 09:53:57 -05:00
Paul Riseborough 8839e4e1f4 EKF: Don't discard declination certainty information when resuming 3-axis fusion.
In the case where the EKF is switching between 3-axis and heading fusion, off-diagonal elements containing the correlation between N,E  components of the earth field were being lost on each switch event. These elements contained information about the declination uncertainty and should be preserved.
2019-01-31 09:53:57 -05:00
Paul Riseborough 25148e1b45 EKF: Prevent rapid changes in declination estimate after a reset
Ensures that each time the earth field covariance and variance data is reset, that the off-diagonal elements containing earth field declination angle certainty is restored.
2019-01-31 09:53:57 -05:00
CarlOlsson 6e7c119b31 EKF: limit yaw variance increase to 0.01 rad^2 to prevent a badly conditioned covariance matrix
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-01-31 09:53:57 -05:00
CarlOlsson 0896f7b9bd EKF: Also fill in lower part of covariance matrix in increaseQuatYawErrVariance()
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-01-31 09:53:57 -05:00
Paul Riseborough 4b3140e5f7 EKF: Fix rebase error 2019-01-31 09:53:57 -05:00
Paul Riseborough 911d4d8f49 EKF: Fix sign error in increaseQuatYawErrVariance function 2019-01-31 09:53:57 -05:00
Paul Riseborough a0b9cb002e EKF: Use consistent method for recording completion of in-flight yaw alignment 2019-01-31 09:53:57 -05:00
Paul Riseborough ef5a87c1d4 EKF: Rework quaternion yaw reset.
Use a new method that preserves the roll and pitch information and adds the uncertainty for yaw only.
Ensure that correlation information to non-quaternion states is removed when a reset occurs to prevent fusion of subsequent observations (e.g. GPS) causing incorrect yaw.
2019-01-31 09:53:57 -05:00
Paul Riseborough fc2a089823 EKF: Add function to un-correlate quaternion states
This is necessary after a quaternion reset to prevent incorrect attitude corrections with subsequent observation fusions.
2019-01-31 09:53:57 -05:00
Paul Riseborough bce1b96d17 EKF: Add function enabling yaw variance to be increased 2019-01-31 09:53:57 -05:00
Paul Riseborough bf1f3a224e EKF: Derive equations enabling yaw variance to be increased 2019-01-31 09:53:57 -05:00