Commit Graph

151 Commits

Author SHA1 Message Date
Paul Riseborough bdf5b3e003 EKF: Don't assume large position uncertainty when starting optical flow nav 2018-05-08 08:43:56 +10:00
Paul Riseborough 389786ef1b EKF: Stop using EV for yaw when GPS fusion starts 2018-05-08 08:42:03 +10:00
Daniel Agar c5b2f59f57 PX4 style fixes (excluding EKF generated code) 2018-05-03 22:25:36 -04:00
Daniel Agar eec71d1a10 EKF get_ekf_soln_status() fix pred_pos_horiz_abs 2018-05-03 00:12:23 -04:00
Daniel Agar a14434d6dc EKF always fill position and velocity accuracy (#425) 2018-04-23 21:15:29 +10:00
Paul Riseborough 6e3403ce28
EKF: prevent race condition between global position validity and eph reporting 2018-04-21 13:04:04 -04:00
Paul Riseborough fdabb9277f
EKF: Use consistent validity definition for global position reporting 2018-04-21 13:04:04 -04:00
Paul Riseborough ae069b12d6
EKF: Fix bug preventing wind relative dead reckoning 2018-04-21 13:04:04 -04:00
Paul Riseborough 9747dc778d
EKF: Rework nav validity reporting
Remove duplicate checking for dead reckoning and consolidate into a single function.
Use separate timers to check for start of dead reckoning and check when dead reckoning has been performed for too long for the nav solution to be valid.
Allow the timeout for validity reporting to be adjusted externally.
Separate external reporting of dead reckoning from internal checks.
2018-04-21 13:04:04 -04:00
Paul Riseborough 02055acee2
EKF: Fix non GPS aiding data reset logic (#418)
* EKF: Move optical flow specific state reset to helper functions

* EKF: Ensure loss of optical flow aiding is handled correctly

If data is only source of aiding and has been rejected for too long - reset using flow data as a velocity reference.
If flow data is unavailable for too long - declare optical flow use stopped.
Use consistent time periods for all resets

* EKF: Ensure loss of external vision aiding is handled correctly

If data is only source of aiding and has been rejected for too long - reset using data as a position.
Don't reset velocity if there is another source of aiding constraining it.
If data is unavailable for too long, declare external vision use stopped.
Use consistent time periods for all resets.

* EKF: Update parameter documentation

Make the distinction between the no_gps_timeout_max and no_aid_timeout_max parameters clearer

* EKF: make class variable units consistent with documentation

* EKF: Don't reset states when optical flow use commences if using external vision

* EKF: Stop optical flow fusion when on ground if excessive movement is detected.

* EKF: fix terrain estimator vulnerabilities

Reset estimate to sensor value if rejected for 10 seconds
Protect against user motion when on ground.
Fix unnecessary duplication of terrain validity check and separate validity update and reporting.

* EKF: remove unnecessary Info console prints

Optical flow use information can be obtained from the estimator_status.control_mode_flags message

* EKF: fix inaccurate comment

* EKF: remove duplicate calculation from terrain validity accessor function
2018-04-09 18:35:15 +10:00
Daniel Agar cd12f049fe move geo and geo_lookup from PX4 Firmware to ECL 2018-03-26 21:52:11 -04:00
Paul Riseborough 8a012436f9
EKF: Fix reversion from GPS to no-aiding mode (#412)
* EKF: Do not delay reversion to no-aiding mode if parameter initiated

* EKF: Move no-aid reversion resets to helper functions

* EKF: Prevent unwanted fusion of velocity data during no aiding mode
2018-03-22 22:39:00 +11:00
ChristophTobler cdc6efc5d6 EKF: fix rot vec calc from quat by using matrix lib 2018-02-08 10:22:55 +01:00
ChristophTobler 9238e2f1a2 EKF: fix spike handling in ev rotation calculation 2018-02-08 10:20:59 +01:00
Paul Riseborough db5264e45c EKF: Add missing reset for output observer vertical position derivative
Required to prevent large transients in value returned by get_pos_d_deriv accessor following a vertical state reset event.
2018-01-31 08:43:39 +01:00
Paul Riseborough f016e66ff8
Revert "EKF: Release flow speed limit with altitude gained" (#382)
* Revert "EKF: Release flow speed limit with altitude gained"

This reverts commit e70206f74b.

* Revert "fix code style"

This reverts commit 76bf70121c.

* Revert "Reverse the linked list of data_validator_group and maintain a first node"

This reverts commit 32482e7644.
2018-01-24 20:46:48 +11:00
ChristophTobler cdbca91e79 EV height reset (#379)
* fix typo

* EKF: use baro if it was reset to baro from ev

* EKF: set vert_pos_reset if resetting to ev hgt

otherwise the position controller will not reset the setpoint -> leading to unwanted altitude changes
2018-01-15 20:15:56 +11:00
CarlOlsson 5c8b22b43f ekf: return beta test ratio in get_innovation_test_status
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2017-12-18 15:48:36 +01:00
Paul Riseborough e70206f74b EKF: Release flow speed limit with altitude gained
When GPS use is gained whilst flying using optical flow data, the sudden release of the speed limit is unannounced to  the operator and can cause unexpected acceleration.
This patch releases the speed limit as height is gained, but does not reduce it when the vehicle descends, unless GPS use is lost.
2017-12-12 01:26:44 +00:00
Paul Riseborough b0ad8269a5 EKF: enable separate monitoring of aux velocity innovations 2017-11-21 11:18:09 +11:00
Paul Riseborough 7c8fcf7628 EKF: Clarify use of *= operator for quaternions 2017-11-16 11:52:19 +11:00
Daniel Agar ed9a394029
EKF RingBuffer avoid copying 2017-11-15 18:08:51 -05:00
Paul Riseborough df9f48d2d3 EKF: Fix build error 2017-11-13 07:05:56 +11:00
Paul Riseborough 279fc836f7 EKF: Always reset covariance matrix terms when doing vel pos state reset
If state errors were large before the reset, then failure to reset the covariance matrix terms can result in incorrect fusion of position and velocity measurements after the reset due to inconsistencies in the covariance matrix.
2017-11-13 07:05:56 +11:00
Paul Riseborough 141264fe63 EKF: Add method to set diagonals in covariance matrix 2017-11-13 07:05:56 +11:00
Paul Riseborough 32de90b9ef EKF: Add method to zero covariance terms 2017-11-13 07:05:56 +11:00
Paul Riseborough 8f27d3fc54 EKF: don't reset quaternion states unnecessarily
When performing the initial in-flight mag yaw reset for RW vehicle, do not reset the quaternion states and corresponding variances unless there has been a change in yaw angle large enough to cause problems with navigation.
This is because the state estimates after a reset are more vulnerable to transient sensor errors, so a reset should be avoided if possible.
2017-11-13 07:05:56 +11:00
Paul Riseborough 9e47b6e1b6 EKF: don't reset quaternions unnecessarily
When performing the initial in-flight magnetic field reset for fixed wing vehicles, resetting the quaternion states and their corresponding covariances should be avoided unless yaw errors are large, because state estimates are vulnerable to transient sensor errors immediately following a reset.
2017-11-13 06:55:02 +11:00
Paul Riseborough 29d383edbf EKF: Allow mag field estimates to stabilise before use 2017-11-13 06:55:02 +11:00
Paul Riseborough 363edf5eb9 EKF: Fix yaw reset for fixed wing
Ensures that a complete reset of velocity and position states will always be performed if yaw has had to be reset using GPS velocity.
Ensures that the yaw_align status cannot be set to false once the filter has aligned.
2017-11-13 06:55:02 +11:00
Paul Riseborough 7852c0ed03
Merge pull request #312 from PX4/pr-ekfExtVisQuat
EKF: Enable operation with arbitrary External Vision reference frame
2017-11-12 08:35:39 +11:00
ChristophTobler e388e59f32 EKF: use uint64_t cast for XeY to avoid float casting of variables
The default type for XeY is float
2017-11-08 11:40:26 +01:00
Paul Riseborough 01d68ef67c EKF: Enable use of rotated external nav estimates 2017-11-01 08:33:57 +11:00
Paul Riseborough 063533afae EKF: Add method to enable the IMU bias states to be reset externally 2017-10-26 10:41:39 +11:00
Paul Riseborough e10ec59058 EKF: Use consistent test for navigation validity reporting
This will enable controller to take advantage of non-inertial dead reckoning.
2017-10-20 14:44:38 +11:00
Paul Riseborough 19074fdd9e EKF: Use consistent time limit for inertial dead reckoning test 2017-10-20 14:44:38 +11:00
Paul Riseborough 929c5c2b37 EKF: enable gps fusion flag to be false while fusing air data 2017-10-20 14:44:37 +11:00
Paul Riseborough 9857fb9eb6 EKF: publish control limits for optical flow navigation 2017-10-20 14:22:06 +11:00
CarlOlsson 2e03084d34 EKF: If aligning yaw for fw with low GPS velocity, use mag 2017-10-19 16:49:54 +02:00
CarlOlsson c81cdfa1ce EKF: Fix bug when resetting position and velocities for fw due to something else than bad yaw estimate
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2017-10-17 15:08:09 +02:00
Paul Riseborough dbff89fbcb EKF: Fix error preventing selection of MAG_FUSE_TYPE_AUTOFW 2017-10-12 19:54:35 +11:00
Paul Riseborough dd5b8525c3 EKF: Use hamiltonian convention for quaternion product order 2017-08-31 11:14:02 +02:00
Daniel Agar 99ba1c3745
EKF trivial code style cleanup 2017-08-25 10:09:11 -04:00
Paul Riseborough 596b8220e2 EKF: Output mag sensor isolation warning first time only 2017-07-31 19:39:07 +10:00
Paul Riseborough ce806768b7 EKF: Improve in-flight mag error detection, recovery and isolation for fixed wing 2017-07-31 19:39:07 +10:00
Paul Riseborough e08da1c599 EKF: Add ability to use EV and GPS data together
Fuse external vision data using a relative position odometry method when GPS data is also being used and enable both GPOS and EV data to be fused on the same time step.
2017-07-26 18:06:18 +10:00
Paul Riseborough e1fe5b2229 Revert "Revert "Split get_terrain_vert_pos() into valid and get_vpos"" 2017-07-19 17:52:35 +10:00
Paul Riseborough c887b02f21 Revert "Split get_terrain_vert_pos() into valid and get_vpos" 2017-07-19 17:33:48 +10:00
ChristophTobler eae0522dc2 split into get_terrain_valid and get_terrain_vert_pos 2017-07-17 16:42:42 +02:00
Paul Riseborough ec2b54fde7 EKF: Ensure normal yaw alignment using mag is performed if GPS method is not 2017-07-08 11:13:40 +02:00