63 Commits

Author SHA1 Message Date
Paul Riseborough
5907e81ef7 EKF: optflow fusion cleanup 2020-08-16 08:44:17 +10:00
Paul Riseborough
7fa9a1963b EKF: optflow fusion cleanup
Co-authored-by: kritz <kritz@ethz.ch>
2020-08-16 08:44:17 +10:00
Paul Riseborough
0e74f3ea9d EKF: optflow fusion cleanup
Co-authored-by: kritz <kritz@ethz.ch>
2020-08-16 08:44:17 +10:00
Paul Riseborough
6e992a18f6 EKF: optflow fusion cleanup
Co-authored-by: kritz <kritz@ethz.ch>
2020-08-16 08:44:17 +10:00
Paul Riseborough
274523bd98 EKF: Use ecl::powf for integer exponents 2020-08-16 08:44:17 +10:00
Paul Riseborough
f20a5d814d EKF: Remove redundant tilt check
Also fix comment indent
2020-08-16 08:44:17 +10:00
Paul Riseborough
1592db8f34 EKF: Convert optical flow fusion to use SymPy generated equations 2020-08-16 08:44:17 +10:00
kamilritz
89bfcc2167 Introduce checkAndFixCovarianceUpdate(KHP) function 2020-07-16 18:25:06 +02:00
kamilritz
e357376797 Bring declaration and initialization together 2020-07-16 18:25:06 +02:00
kamilritz
122f58b94d Bug: stop overwriting fault status of index 0 with index 1 2020-07-02 15:55:24 +02:00
kamilritz
16a00eae0b Make Kfusion a Vector24f 2020-07-02 09:02:24 +02:00
kamilritz
552bf824ea Add typedef for Matrix 24 types 2020-07-02 09:02:24 +02:00
kamilritz
5356077a32 Make flow_innov/-var a matrix Vector2f 2020-06-26 08:26:26 +02:00
kamilritz
c2801eb488 Add const modifier and increase matrix library usage 2020-06-26 08:26:26 +02:00
kamilritz
48f0eb16da Remove uninformative comments 2020-06-26 08:26:26 +02:00
kamilritz
4a69b41015 Increase matrix library usage even more 2020-06-26 08:26:26 +02:00
kamilritz
ff8b5ec69d Extract general functions into utils 2020-06-23 08:18:34 +02:00
kamilritz
f3d790a664 Update optical flow interface 2020-01-24 16:18:42 +03:00
kamilritz
36da8d82c8 Clean up white space 2020-01-08 09:00:31 +01:00
kamilritz
48787c0160 Improve Matrix library usage 2020-01-08 09:00:31 +01:00
kamilritz
9e6d27fafb Add missing const qualifier 2020-01-08 09:00:31 +01:00
Paul Riseborough
0d0f46ec1c EKF: Don't run unnecessary makeRowColSymmetric operation
This operation is expensive when done to the whole covariance matrix and unnecessary after covariance prediction because we calculate the upper diagonal and copy across so it is already symmetric.
2020-01-02 19:26:57 +11: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
Daniel Agar
98a1aae494 EKF: use Matrix cross product 2019-12-17 09:35:08 +01:00
kamilritz
d5dc6bb8ea Clean get*innov* interface 2019-12-05 20:09:34 +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
Carl Olsson
f0889c1760 EKF: fixed some comment typos
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-18 10:20:33 -04:00
Daniel Agar
b920910483 replace <cfloat> with <float.h>
- <cfloat> isn't available in the NuttX c++ library
2019-01-06 12:09:05 -05:00
Roman
27f7846495 optical flow: fixed sign in calculation of optical flow sensor velocity
- the velocity of the optical flow sensor relative to the IMU expressed in
body frame is the cross product of the angular velocity with the vector
from IMU to the sensor. If we use the angular velocity stored in the flow
sample struct we need to use a negative sign as that angular velocity
follows the opposite sign convention.

Signed-off-by: Roman <bapstroman@gmail.com>
2018-12-04 01:26:40 +11:00
Roman Bapst
ee85a29202 Pr opt flow (#482)
* optical flow: fixed calculation of velocity of the flow sensor relative to
the IMU

- gyroXYZ holds a delta angle and first needs to converted to a gyro rate

Signed-off-by: Roman <bapstroman@gmail.com>

* optical flow: calculate height above the ground with respect to the flow
camera
- the flow camera can be offset from the IMU which needs to be considered

Signed-off-by: Roman <bapstroman@gmail.com>

* estimator interface: fixed comment regarding optical flow sample timestamp

- the timestamp on an optical flow sample corresponds to the trailing
edge of the flow integration period

Signed-off-by: Roman <bapstroman@gmail.com>
2018-07-16 11:41:35 +10:00
Roman
c8af315aa7 flow_fusion: corrected sign of gyro data when it is taken from the ekf
gyro data

Signed-off-by: Roman <bapstroman@gmail.com>
2018-06-13 21:52:42 +02:00
Paul Riseborough
de7c9d85a4 EKF: Handle flow data without valid gyro data 2018-06-12 16:24:25 +10:00
Paul Riseborough
d177e96508 EKF: Fix bug causing slow drift when high rate flow data is used
High rate optical flow data could make flow fusion to run every major update cycle, resulting in the calculation of bias errors in the body rates used to compensate flow data failing time validity checks and not running. This resulted in a slow drift of the nav solution if bias errors were present in the in the gyro data used for flow sensor motion compensation.
2018-06-09 22:23:55 +02:00
Mohammed Kabir
b4d2b8c57d EKF : introduce new architechture for navigation limits 2018-06-09 22:23:55 +02:00
Paul Riseborough
0160aaa568 EKF: Don't use magnetometer with optical flow only nav if GPS checks are failing 2018-06-09 22:23:55 +02:00
Daniel Agar
c5b2f59f57 PX4 style fixes (excluding EKF generated code) 2018-05-03 22:25:36 -04:00
Daniel Agar
cd12f049fe move geo and geo_lookup from PX4 Firmware to ECL 2018-03-26 21:52:11 -04:00
Paul Riseborough
1d3e8edc46 EKF: Fix bug in accumulation of IMU data for flow sensor gyro bias calculation 2017-09-14 18:34:11 +10:00
Daniel Agar
99ba1c3745
EKF trivial code style cleanup 2017-08-25 10:09:11 -04:00
Daniel Agar
c44488fdb8
EKF matrix typedef cleanup 2017-06-19 11:10:01 -04:00
Paul Riseborough
e35921534d EKF: fix reporting of optical flow fusion errors 2017-04-29 11:46:39 +02:00
Paul Riseborough
465b145929 EKF: Add multi-rotor drag model for wind estimation 2017-04-16 13:07:12 +02:00
Paul Riseborough
b536382ae1 EKF: remove dead code 2017-01-15 10:02:31 +01:00
Beat Küng
07c6aabd98 EKF: reduce KH to only the elements that are really needed, and merge the loops 2016-11-02 10:26:40 +01:00
Paul Riseborough
1b59a89a18 EKF: save some stack memory 2016-11-02 09:06:06 +01:00
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.
2016-11-01 22:49:20 +01:00
Paul Riseborough
7bc9217f00 EKF: Clean up control of observation fusion
All the decision for a sensor are made within a specific function for that sensor and when there is data to process at the fusion time horizon.
Information and warning messages are improved.
2016-06-30 17:06:32 +10:00
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.
2016-06-01 17:13:00 +10:00
Paul Riseborough
52229da089 EKF: capture optical flow innovation test failures 2016-06-01 17:13:00 +10:00