136 Commits

Author SHA1 Message Date
Paul Riseborough
34ffffa021 EKF: Prevent use of non time-stamped invalid data during initialisation
Fixes bad height initialisation seen intermittently with snapdragon
2016-06-08 11:56:07 +10:00
Paul Riseborough
081e17729c EKF: delay commencement of 3D mag fusion until clear of ground
Wait until enough height has been gained to be clear of ground based magnetic anomalies. Failure to do so can result in incorrect earth field initialisation.
2016-06-06 21:59:46 +10:00
Paul Riseborough
81ca167da8 EKF: align output observer to EKF states on startup 2016-06-01 17:13:00 +10:00
Paul Riseborough
733862f649 EKF: move the reset status struct to the Ekf class
This protects it from being modified externally
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
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
388e500180 EKF: remove un-used magnetometer health class variable
replaced by _sensor_health_status
2016-06-01 17:13:00 +10:00
Paul Riseborough
aea827aa8a EKF: ensure filter fault status is initialised 2016-06-01 17:13:00 +10:00
Paul Riseborough
106482b078 EKF: add structure to capture innovation test failures and state resets 2016-06-01 17:13:00 +10:00
Paul Riseborough
70c40d695d EKF: Initialise alignment noise filters using valid data
Don't initialise the states for the alignment data noise filters until the buffers have been flushed
2016-05-28 09:04:26 +10:00
Paul Riseborough
c905684c12 EKF: Ensure bad initial data is flushed from buffers before using data to perform alignment 2016-05-28 08:28:57 +10:00
Paul Riseborough
98c0b74a71 EKF: Initialise height correctly when using external vision data
If EV height selected ensure switch to correct height mode as soon as EV data is received
The 0 height datum is not at the initialisation position, so the height state needs to be reset to the measurement on startup
2016-05-27 13:59:14 +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
90d65071c1 EKF: Add output predictor processing option
Setting the velocity tracking tine constant to a negative number causes the output predictor to use a different method of correcting the velocity which provides a velocity output that is kinematically consistent with the position output.

This may improve height controller performance under some circumstances
2016-05-23 07:47:10 +10:00
Paul Riseborough
c8c2d6d963 Merge pull request #145 from CarlOlsson/small_fix
Deleted second update of transformation matrix
2016-05-23 07:40:58 +10:00
Carl Olsson
0fafc49a49 fixed typos (#147) 2016-05-22 17:40:43 +02:00
CarlOlsson
eb70aca2e8 deleted second update of transformation matrix 2016-05-22 16:03:30 +02:00
waltjohnson
7c158aa59b Addressed C99 compiler issues of initializing variables in header and unused included statements. 2016-05-19 09:58:18 -06:00
Paul Riseborough
e3b9800cac Merge pull request #138 from pickledgator/evTesting
EV testing
2016-05-19 12:56:41 +10:00
Paul Riseborough
b9a3712ccb EKF: record yaw alignment event during initialisation to allow heading fusion to start early
This ensures bad yaw gyro biases are compensated for early, rather than waiting for the tilt alignment to fully converge before fusing heading.
2016-05-18 19:25:19 +10:00
Paul Riseborough
22fba0fc6e EKF: don't initialise filter without EV data if we are relying on it 2016-05-18 19:25:19 +10:00
Nic
1b16f3575a added ev_pos flag check to valid_lpos, disable fake gps when ev_pos is valid 2016-05-17 21:07:04 -07:00
Paul Riseborough
c955bfbf93 EKF: fix previous merge error 2016-05-15 20:36:51 +10:00
Paul Riseborough
349c731375 EKF: remove PX4 dependant text output 2016-05-14 21:17:29 +10:00
devbharat
cf1df5861a Undid hack in ecl. Handled yaw missalignment on the vision side. 2016-05-14 21:17:29 +10:00
devbharat
d16f413b55 Hack to fix external vision pos offset compensation 2016-05-14 21:17:29 +10:00
devbharat
d3bad9fdb0 Correct height fusion flag when using sensor other than baro 2016-05-14 21:17:29 +10:00
devbharat
b681c9a5d0 Added external vision noise parameters etc and position offset 2016-05-14 21:17:29 +10:00
devbharat
ff8f03b5dd Added compensation for VI sensor offset. Check sign. 2016-05-14 21:17:29 +10:00
Paul Riseborough
e917d6c7f2 EKF: Add fusion of external yaw data 2016-05-14 21:17:29 +10:00
Paul Riseborough
25f1d1d766 EKF: Add fusion of external vision 3D pos data 2016-05-14 21:17:29 +10:00
Paul Riseborough
81469d6621 EKF: Add position, height and velocity reset for EV aiding 2016-05-14 21:17:29 +10:00
Paul Riseborough
c7e225124c EKF: Improve output observer position and velocity tracking
Replace the delayed time feedback mechanism used by the translational states with a direct feedback method.
Time constants for velocity and position convergence can be separately adjusted with tunable parameters
The method is more computationally more expensive because it requires modification of the output buffer history but is acceptable because it only requires 6 FLOP per buffer index for a total of 30*6 = 180 FLOP
The method was not applied to the attitude states because the quaternion operations required at each buffer index would have been computationally prohibitive.
2016-05-14 12:45:29 +09:30
Paul Riseborough
627d08ecc9 Revert "EKF: Fix bug in output observer"
This reverts commit 03f3df741589627bf15225327289b01916cc1a90.
2016-05-14 12:26:46 +09:30
Paul Riseborough
03f3df7415 EKF: Fix bug in output observer
Bug was causing output observer state history to be stored at the the EKF, not IMU output rate and resulted in degraded tracking performance
2016-05-14 08:33:05 +09:30
Paul Riseborough
481c624975 EKF: Remove use of vehicle arm status
Use single externally set in-air status for all decisions
2016-05-10 10:23:08 +10:00
Paul Riseborough
0c6a367e1b EKF: fix Travis build error 2016-05-07 17:45:49 +10:00
Paul Riseborough
22f0f52bf1 EKF: fix travis build error 2016-05-07 17:06:45 +10:00
Paul Riseborough
da9d894441 EKF: Improvements to covariance reset 2016-05-07 12:57:41 +10:00
Paul Riseborough
f1b7e7714e EKF: Make average update rate of EKF closer to target
With the EKF, the average update rate is more important than the instantaneous value as it affects tuning. This patch ensures that the EKF prediction cycle will be performed early if the previous one was late in an attempt to maintain the target update rate.
2016-05-05 21:23:03 +10:00
Paul Riseborough
5523a4f225 EKF: Fix IMU bias compensation scale error in output filter
Delta angle and velocities are calculated assuming data is at the filter update rate, not the IMU update rate
2016-05-05 21:23:03 +10:00
Paul Riseborough
727a43764f EKF: update initial angle alignment check 2016-05-05 21:23:03 +10:00
Paul Riseborough
ffea65e1a4 EKF: fix bug in state prediction 2016-05-05 21:23:03 +10:00
Paul Riseborough
7530e30012 EKF: Improve IMU data collection
Use IMU driver published delta angle integration time to determine when enough data has been accumulated.
Perform basic first order sculling corrections on delta velocity data
Comment steps to make make method clearer
2016-05-05 21:23:03 +10:00
Paul Riseborough
54e713969d EKF: Fix rebase error 2016-05-05 21:23:03 +10:00
Paul Riseborough
fe9f88a8b4 EKF: test new derivation
Use direct attitude parameterisation
Discard scale factors
Add accel bias
2016-05-05 21:23:03 +10:00
Beat Küng
f2dda3c183 ekf: initialize _terrain_var, fixes access to uninitialized value
in PX4 Firmware, Ekf::get_terrain_vert_pos depends on it. This is the
valgrind output:
==15439== Thread 14 ekf2:
==15439== Conditional jump or move depends on uninitialised value(s)
==15439==    at 0x5610087: sqrtf (in /usr/lib64/libm-2.22.so)
==15439==    by 0x4D1AF0: Ekf::get_terrain_vert_pos(float*) (terrain_estimator.cpp:135)
==15439==    by 0x46641F: Ekf2::task_main() (ekf2_main.cpp:655)
==15439==    by 0x42BF3D: entry_adapter(void*) (px4_posix_tasks.cpp:103)
==15439==    by 0x4E3C609: start_thread (in /usr/lib64/libpthread-2.22.so)
==15439==    by 0x5BF7A4C: clone (in /usr/lib64/libc-2.22.so)
2016-05-02 17:35:42 +02:00
Paul Riseborough
6c57bea1c3 EKF: fix bug in IMU error application timing patch 2016-04-30 15:11:12 +10:00
Paul Riseborough
15df20831a EKF: improve output complementary filter tracking
Optimise for height tracking and adjust gains automatically with changes in time delay.
2016-04-30 11:03:45 +10:00
Paul Riseborough
4fa1e9c651 EKF: Fix timing errors in state prediction
IMU corrections were being applied at the wrong time horizon to the EKF states
IMU downsampling rotates the delta velocities into the orientation produced by the last delta angle, but this wasn't consistent with the way the state prediction was using the delta velocity data.
2016-04-30 11:02:19 +10:00