96 Commits

Author SHA1 Message Date
Paul Riseborough
394dd95cba EKF: Don't do magnetic field estimation without earth frame measurements
Use horizontal acceleration to check if yaw is observable independent of the magnetometer.
Use rotation about the vertical to check if mag raises are observable.
If neither yaw of mag biases are observable, save the magnetic field variances and switch to magnetic yaw fusion.
Use the last learned declination when using magnetic yaw fusion so that the yaw reference remains consistent.
When yaw or biases become observable, reinstate the saved variances and switch back to 3D mag fusion.
2017-05-17 08:59:01 +02:00
Paul Riseborough
20db74eca8 Revert "EKF: Add parameter control of individual IMU axis delta velocity bias estimation"
This reverts commit 9c31632e2bd8c53843dfc9dc419256607578350e.
2017-05-15 16:38:17 +10:00
Paul Riseborough
9c31632e2b EKF: Add parameter control of individual IMU axis delta velocity bias estimation
Add a bitmask parameter to control bias learning for individual axes. This is achieved by setting the disabled states to zero together with their corresponding covariances.
Minor cleanup of the covariance prediction comments.
Removal of unnecessary variable copy operations.
Replace index operations to initialise covariance to zero with the more efficient memset.
2017-05-11 07:51:37 +02:00
Daniel Agar
3919d60f66
ekf2 initialization fixes 2017-04-24 18:56:50 -04:00
Paul Riseborough
f0bbbc8dc6 EKF: Add reporting of bad accel status 2017-04-07 08:47:13 +10:00
Paul Riseborough
040639837e EKF: Use common timeout test for reporting deadreckoning
Use a parameter to set the time-out threshold
Use a class variable for the time-out flag
Clean up comments
2017-03-15 07:57:38 +01:00
Paul Riseborough
6ac7e2f807 EKF: report conservative position errors when failing innovation checks 2017-03-15 07:57:38 +01:00
Paul Riseborough
21e7734149 EKF: fix compile error 2017-03-14 13:00:54 +01:00
Paul Riseborough
f7cae7f3ab EKF: improve compatibility with ARM cross compiler
This change removes the following compiler error when building using the ARM cross compiler.

/Users/paul/src/Firmware/src/lib/ecl/EKF/ekf_helper.cpp:45:12: error: 'std::abs' has not been declared
 using std::abs;
2017-03-12 22:55:23 +01:00
Paul Riseborough
cf31945038 EKF: Fix use of incorrect timestamp
This was incorrectly using the IMU (1/250 sec) timestamp instead of the EKF (1/100 sec) value.
The corresponding accelerometer limit has been made a parameter and adjusted to match previous behaviour.
2017-03-10 10:14:06 +01:00
Paul Riseborough
e4a4427991 Revert "EKF: fix compile error"
This reverts commit 6db552717deefff6b4ad7078bcf4c769d94f1957.
2017-03-10 07:38:02 +11:00
Paul Riseborough
6db552717d EKF: fix compile error 2017-03-07 21:13:45 +11:00
Daniel Agar
eb4f5ecbb9 cmake add all EKF sources (#243)
- trivial cmake cleanup
 - travis-ci build with both gcc and clang
 - update matrix to latest (matches PX4)
 - closes #240
2017-02-27 00:46:48 -05:00
Paul Riseborough
0d77470efc EKF: Use conservative reporting of velocity errors when aiding is lost 2017-02-25 21:17:01 +01:00
Paul Riseborough
8070691aa4 EKF: Add accessor function for velocity accuracy 2017-02-25 21:17:01 +01:00
Paul Riseborough
d6abf3f2e4 EKF: add accessor function for local position accuracy 2017-02-25 21:17:01 +01:00
Paul Riseborough
b7d0b3c4d0 EKF: Improve naming of WGS-84 accuracy accessor function 2017-02-25 21:17:01 +01:00
Paul Riseborough
d22599b440 EKF: Add reporting of inertial dead-reckoning status 2017-02-25 21:17:01 +01:00
Daniel Agar
2750961be6 c++11 initialization cleanup (#237) 2017-02-05 13:05:10 -05:00
Daniel Agar
47b8ef258b clang-tidy performance-type-promotion-in-math-fn (#236) 2017-02-02 00:17:08 -05:00
Daniel Agar
d668a2d798 clang-tidy performance-unnecessary-value-param 2017-01-14 16:26:25 -08:00
Paul Riseborough
934890c2df EKF: Add validity flag to ekf origin reporting
Flag is false until the origin has been initialised
2016-12-28 00:56:09 +01:00
CarlOlsson
c8e3c24150 adopted ekf_helper.cpp 2016-11-05 12:19:01 +01:00
Paul Riseborough
b10b0184c5 EKF: Add IMU vibration calculation and reporting
Add calculation and reporting of IMU delta angle and velocity coning and high frequency vibration
2016-10-19 21:46:55 +11:00
Roman
17c195d1cd ekf2 height reset: do not apply height change to height state twice (bug)
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 07:58:19 +02:00
Roman
f80b3481a4 reset the newest output sample for all possible resets
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-12 08:54:38 +02:00
Roman
238d947239 proper handling of position and velocity reset
- position reset method was returning before the actual delta values
were written and applied to the output buffer
- apply reset delta also to the output sample which was already taken out
from the output buffer, otherwise the complementary filter solution is
offset from the ekf solution

Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-12 08:54:38 +02:00
Paul Riseborough
352750e5d1 EKF: publish ekf solution status summary data 2016-10-06 09:02:29 +02:00
Paul Riseborough
007e73379f EKF: Improve reporting of position error 2016-10-06 09:02:29 +02:00
Paul Riseborough
744b79c1b2 EKF: Publish innovation test ratios 2016-10-06 09:02:29 +02:00
Paul Riseborough
65762e5998 EKF: publish output predictor tracking errors 2016-10-03 14:13:07 +11:00
Julian Oes
616aeb9ad7 ekf_helper: fix forgotten return value 2016-09-27 16:36:29 +02:00
Beat Küng
73b8ac954d ekf_helper.cpp: remove unused includes
This fixes a compile error with GCC 5.2.0 and cross-compilation:
/usr/arm-none-eabi/include/c++/5.2.0/arm-none-eabi/armv7e-m/fpu/bits/error_constants.h:122:27: error: 'ENOTSUP' was not declared in this scope
       not_supported =     ENOTSUP,

The problem was that the #include <iomanip> was taken from the host system,
which conflicts with includes from NuttX (NuttX has only basic C++ STL
support)
2016-07-15 12:50:11 +02:00
Paul Riseborough
f5e9ea1626 EKF: Prevent potential divide by zero 2016-06-30 17:06:32 +10: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
Roman Bapst
bec1a6831e added method to get gyro bias
Signed-off-by: Roman Bapst <roman@px4.io>
2016-06-21 14:13:47 +02:00
Roman
703fb4e31b do not return early in velocity reset method otherwise
some code will not be executed
2016-06-08 07:51:18 +02:00
Paul Riseborough
f26aca55a1 EKF: Fix bug in quaternion covariance initialisation function
The covariances between quaternion and non-quaternion states were not being updated
2016-06-08 13:23:30 +10:00
Paul Riseborough
6a55d908c5 EKF: replace reset event times with event counters
Using a 64bit integer was unnecessary given it was only being used to detect a new reset event.
2016-06-01 17:13:00 +10:00
Paul Riseborough
9ec09f5f4e EKF: update output observer and capture reset event for magnetic heading resets 2016-06-01 17:13:00 +10:00
Paul Riseborough
aca0336392 EKF: update vertical position and velocity reset capture
Use reset event struct members instead of separate variables
2016-06-01 17:13:00 +10:00
Paul Riseborough
0605c88ecc EKF: capture horizontal position reset events 2016-06-01 17:13:00 +10:00
Paul Riseborough
e3a1b4a3b3 EKF: capture velocity reset events 2016-06-01 17:13:00 +10:00
Paul Riseborough
79705da7e6 EKF: make output predictor states consistent with position reset 2016-06-01 17:13:00 +10:00
Paul Riseborough
54d90261d5 EKF: make output predictor states consistent with velocity reset 2016-06-01 17:13:00 +10:00
Paul Riseborough
ad02818b3d EKF: Improve height reset for external vision
reset to measurement closest in time to fusion time horizon
2016-05-27 14:00:50 +10:00
Paul Riseborough
1b6c5bbafd EKF: Enable height source to be selected independent of EV aiding 2016-05-27 13:14:52 +10:00
Paul Riseborough
ae5071f668 EKF: Improve heading reset
Improves reset of quaternion covariance matrix after a heading reset by preserving variance in roll and pitch and resetting yaw variance to the measurement variance.
2016-05-21 19:30:15 +10:00
Paul Riseborough
94a63ec9d5 EKF: don't interfere with quaternion covariances during tilt alignment 2016-05-18 19:25:19 +10:00
Paul Riseborough
e4b2e9c93d EKF: Improve yaw alignment
Uses best conditioned of 321 or 312 Euler sequence to calculate initial yaw angle.
Allows alignment of yaw angle using external vision data
2016-05-18 12:16:16 +10:00