287 Commits

Author SHA1 Message Date
Paul Riseborough
21054a4236 EKF: Fix bug causing incorrect covariance initialisation
The covariance initialisation should not be performed before the quaternion states are initialised.
2020-02-05 15:20:34 +01:00
kritz
ee859e092a Robustify timestamp checks (#729)
* Robustify timestamp checks

* Remove lowerbound on sensor timestamp

* Add tests for fusion timeouts

* Inline and const time check functions

* Rename dead_reckoning time variable
2020-01-28 20:33:16 +11:00
bresch
e3af91c9ce Ekf: use helper functions to centralize the checks of horizontal aiding (gps, flow, ev_pos, ev_vel) 2020-01-24 17:22:50 +04:00
kamilritz
f3d790a664 Update optical flow interface 2020-01-24 16:18:42 +03:00
kamilritz
4b0e7b2cff Remove filtering on external vision alignment 2020-01-24 08:23:12 +01:00
kamilritz
29c5954690 Move baro downsampling and dynamic pressure comp to ECL 2020-01-21 10:09:48 +03:00
kamilritz
07e8e88e88 Support full vision variance 2020-01-08 14:36:03 +01:00
kamilritz
2657e4fc0c Improve naming and white space 2020-01-08 09:00:31 +01:00
kamilritz
0b18143745 Improve readibility 2020-01-08 09:00:31 +01:00
kamilritz
3daf25763e Remove unnecessary comments 2020-01-08 09:00:31 +01:00
kamilritz
48787c0160 Improve Matrix library usage 2020-01-08 09:00:31 +01:00
kamilritz
a21a7cd5b9 Remove output argument from calcEarthRateNed 2020-01-08 09:00:31 +01:00
kamilritz
9e6d27fafb Add missing const qualifier 2020-01-08 09:00:31 +01:00
kamilritz
92ba618f57 Improve on flash memory usage 2020-01-02 19:26:57 +11:00
kamilritz
459b76f9fd Make covariance matrices of type matrix::SquareMatrix
and use functions from Matrix to reset covariances.
2020-01-02 19:26:57 +11:00
kamilritz
490c749f80 Revert if statement swap in resetMagHeading 2019-12-18 10:06:31 +01:00
kamilritz
ef9f1053d0 Random improvements 2019-12-18 09:46:32 +01:00
Daniel Agar
98a1aae494 EKF: use Matrix cross product 2019-12-17 09:35:08 +01:00
kamilritz
64652f523b Improve quality of comments 2019-12-12 08:48:10 +01:00
kamilritz
1bf09fd370 Remove EKF prefix from logged messages 2019-12-12 08:48:10 +01:00
kamilritz
181303488c Log height innovation sensor specific 2019-12-05 20:09:34 +11:00
kamilritz
ecd199d5d0 Fix vel pos test ratio 2019-12-05 20:09:34 +11:00
kamilritz
07e804676c Rename IMU biases 2019-12-05 20:09:34 +11:00
kamilritz
dae8c2f8dc Group velocity and position as a 3d vector 2019-12-05 20:09:34 +11:00
kamilritz
beedf1ce4f Add print statement to reset vel or pos function 2019-12-05 20:09:34 +11:00
kamilritz
5c038a3b43 Add stop*Fusion function 2019-12-05 20:09:34 +11:00
kamilritz
d5dc6bb8ea Clean get*innov* interface 2019-12-05 20:09:34 +11:00
kamilritz
86b9079bdc Refactoring velPos fusion 2019-12-05 20:09:34 +11:00
Mathieu Bresciani
c7bdf25663
[ekf] controlMagFusion refactor and mag field strength check (#662)
* ekf_control: Inhibit mag fusion when field magnitude is large
Move mag inhibition check in separate function

* ekf_control: pull out of functionalities out of controlMagFusion
- yaw abd mag bias observability checks
- mag 3D conditions
- load mag covariances
- set and clear mag control modes

* ekf_control: refactor mag heading/3D start/stop.
Move mag declination, mag 3d and mag heading fusion out of the main function

* ekf_control: extract mag yaw reset and mag declination fusion requirements

* ekf_control: use WMM in isStronMagneticField for mag fusion inhibition
- Correct units of WMM strength table

* ekf_control: extract mag_state_only functionality of AUTOFW (VTOL custom)
Also split inAirYawReset from onGroundYawReset

* ekf_control: extract mag automatic selection
- transform if-else into switch-case for parameter fusion type selection

* ekf_control: extract run3DMagAndDeclFusion, reorganize functions, fix
flag naming in Test script

* ekf_control: do not run mag fusion if tilt is not aligned.
Reset some variables on ground even if mag fusion is not running yet. It
could be that it runs later so we need to make sure that those variables
are properly set.

* ekf_control: move controlMagFusion and related functions to mag_control.cpp

* ekf control: check for validity of mag strength from WMM and falls back
to average earth mag field with larger gate if not valid

* ekf control: remove evyaw check for mag inhibition

* ekf control: change nested ternary operator into if-else if

* Ekf: create AlphaFilter template class for simple low-pass filtering
0.1/0.9 type low-pass filters are commonly used to smooth data, this
class is meant to abstract the computation of this filter

* ekf control: reset heading using mag_lpf data to avoid resetting on an outlier
fixes ecl issue #525

* ekf control: replace mag_states_only flag with mag_field_disturbed and
add parameter to enable or disable mag field strength check

* ekf control: remove AUTOFW mag fusion type as not needed This was implemented for VTOL but did not solve the problem and should not be used anymore

* ekf control: use start/stop mag functions everywhere instead of setting the flag

* ekf control: Run mag fusion depending on yaw_align instead of tilt_align
as there is no reason to fuse mag when the ekf isn't aligned

* AlphaFilter: add test for float and Vector3f
2019-11-08 16:02:59 +01:00
RomanBapst
6299d8199c ekf_helper: use latest validated range sample to reset height
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-24 07:55:37 +11:00
Paul Riseborough
4d37065f1b EKF: Make use of inverse rotation function consistent with name
The quaternion to inverse rotation matrix function has been updated so that the rotation it produces is the inverse to that produced by the matrix library and the the inverse of the quaternion is uses. This function is now used to directly calculate an inverse rotation matrix rather than calculating the forward rotation and then transposing it.
2019-10-23 14:44:08 +03:00
Paul Riseborough
36de2b3dc1 EKF: Use matrix library for quaternion to rotation matrix conversion 2019-10-23 14:44:08 +03:00
bresch
b38458c2ab Terrain estimator: formatting and remove redundant comments 2019-10-22 20:19:56 +11:00
kritz
4a38f5a2f6 Add timestamp to ECL print statements, (#644)
which is helpful for EKF replay debugging.
2019-09-25 11:24:42 +02:00
kamilritz
fd6b364c11 posNED to pos and velNED to vel and add ev vel covariances to reset 2019-09-24 07:48:46 +10:00
kamilritz
cea053820d Remove spaces with tabs 2019-09-24 07:48:46 +10:00
kamilritz
1e57c4bbec Fix white space 2019-09-24 07:48:46 +10:00
kamilritz
10cbd79db7 Rotate external vision info in reset function if necessary 2019-09-24 07:48:46 +10:00
kamilritz
4511b9ff5e Add missing checks for flags.ev_vel 2019-09-24 07:48:46 +10:00
kamilritz
3e8139ff9f Enable vision velocity fusion 2019-09-24 07:48:46 +10:00
kamilritz
c5abfe626f remove canonicalize and adapt comments 2019-08-29 08:34:10 +10:00
kamilritz
a2ff415fe4 Fix get frame aligning quaternion function 2019-08-29 08:34:10 +10:00
kamilritz
53eac6e94e Canonicalize alignment quaternion 2019-08-29 08:34:10 +10:00
kamilritz
933c32c921 Enable local frame alignment also without using it 2019-08-29 08:34:10 +10:00
kamilritz
ea352a6631 Dont use mag suffix for magnitude 2019-08-29 08:34:10 +10:00
kamilritz
05196db79e Fix alignment of local frame 2019-08-29 08:34:10 +10:00
Paul Riseborough
a036cf82cc EKF: Remove use of of quaternion self product operator and fix delta rotation sign 2019-06-17 19:24:55 +10:00
Paul Riseborough
0e946f25fd EKF: Remove use of quaternion self product operator and fix delta rotation sign error 2019-06-17 19:24:55 +10:00
CarlOlsson
ad7f7af03b ekf: correct quaternion multiplication order 2019-06-17 19:24:55 +10:00
CarlOlsson
d6351bd7a5 EKF: update comment 2019-06-17 19:24:55 +10:00