183 Commits

Author SHA1 Message Date
Paul Riseborough
02963a85c4 EKF: relax optical flow on ground motion checks 2018-05-08 08:43:14 +10:00
Paul Riseborough
24b005ed57 EKF: range finder aiding logic fixes 2018-05-08 08:42:29 +10:00
Paul Riseborough
0c0a6602b0 EKF: Decouple range finder use criteria checking and selection 2018-05-08 08:42:29 +10:00
Paul Riseborough
6708bec1b4 EKF: Don't auto select range finder for height when on ground. 2018-05-08 08:42:03 +10:00
Paul Riseborough
0a63052753 EKF: Fix false triggering of optical flow bad motion checks 2018-05-08 08:42:03 +10:00
Paul Riseborough
f9d4934db6 EKF: update comments 2018-05-08 08:42:03 +10:00
Paul Riseborough
82de3141f0 EKF: Don't use optical flow if GPS is good and the vehicle is not using range finder for height 2018-05-08 08:42:03 +10:00
Paul Riseborough
389786ef1b EKF: Stop using EV for yaw when GPS fusion starts 2018-05-08 08:42:03 +10:00
Paul Riseborough
4ab78230e6 EKF: Add persistence criteria to GPS fail check 2018-05-08 08:41:15 +10:00
Paul Riseborough
67d71ca406 EKF: allow GPS fallback if quality bad and alternative aiding available 2018-05-08 08:41:15 +10:00
Daniel Agar
c5b2f59f57 PX4 style fixes (excluding EKF generated code) 2018-05-03 22:25:36 -04:00
Paul Riseborough
1bd1809d6e
EKF: Fix bug causing simultaneous range and baro height fusion (#429) 2018-05-03 13:24:33 +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
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
1bb4c17c0e
EKF: Allow use of large GPS position observation noise when using other aiding sources (#403) 2018-03-27 11:31:37 +11: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
Carl Olsson
f6d23cc621 added rng_stuck to filter control status flags (#392) 2018-03-21 11:46:27 +11:00
Paul Riseborough
78e983073a
EKF: Fix bug in use of gps velocity noise parameter (#401)
This fixes a bug introduced by an earlier feature request PR. The parameter is supposed to define the lower limit on the observation noise.
2018-02-28 11:48:53 +11:00
Paul Riseborough
a2d6a4dded
EKF: fix indexing bug (#387)
Should use index 9 for vertical position.
2018-01-29 08:09:55 +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
Paul Riseborough
83b765f707 EKF: Don't print navigation lost message on startup 2017-12-03 23:02:02 +00:00
Paul Riseborough
89be63d6c2 EKF: Fix vel pos innovation logging bug 2017-11-24 14:25:44 +11:00
Paul Riseborough
b0ad8269a5 EKF: enable separate monitoring of aux velocity innovations 2017-11-21 11:18:09 +11:00
Paul Riseborough
2a57fd858d EKF: clean up reset of fusion flags 2017-11-21 11:18:09 +11:00
Paul Riseborough
8e30c2666d EKF: Add support auxiliary velocity observation
This enables the EKF to use an additional NE velocity measurement. This can be used to improve position hold stability when landing using a beacon system for positioning by fusing the beacon velocity estimates.
2017-11-21 11:18:09 +11:00
Paul Riseborough
a2b24fa960 EKF: Protect against ground effect induced static pressure rise during landing and takeoff.
Apply a dead-zone to the vertical position innovation if using baro for height and if in the ground effect region during and just after takeoff.
Method needs to be activated externally.
Turns off automatically after 10 seconds or if specified height gained.
2017-11-17 21:41:31 +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
2b20c52c4d EKF: Remove redundant code 2017-11-15 22:03:17 +11:00
Paul Riseborough
72a7ab2c25 EKF: Improve resistance to bad initial mag offset
When magnetic field states have been reset in-flight using a single sample, the magnetic field states are not used to constrain heading drift for a period after the reset. This period has been shortened from 10 to 5 seconds which is enough time to average out the effects of measurement noise (the original concern). The shorter time has enabled the previous practice for RW vehicles of using magnetic heading in that time period to constrain yaw drift to be discontinued. This is necessary becasue while magnetic heading is being used, it fights the yaw corrections obtained from GPs observations and lengthens the time required to recover from a bad mag calibration.
2017-11-13 07:05:56 +11:00
Paul Riseborough
c70363c501 EKF: Don't fuse heading if FW and waiting for mag states to stabilise
Doing so is a bad idea because bad mag data can drag the yaw angle away from the reset value and lead to rejection of GPS.
2017-11-13 07:05:56 +11:00
Paul Riseborough
f3e34eddc9 EKF: do not attempt to align FW yaw using GPS method if on ground 2017-11-13 07:05:56 +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
Paul Riseborough
5fd006ca48 EKF: remove redundant code 2017-11-11 07:06:01 +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
59f1c3e19e EKF: Update dead-reckoning definition
Use of air data to navigate should be classified as dead-reckoning because neither ground relative velocity or position is observed directly and errors grow faster.
2017-10-20 14:44:37 +11:00
Paul Riseborough
a2dcd5b9b6 EKF: Consolidate no aiding reset logic 2017-10-20 14:44:37 +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
204a218ee6 EKF: Allow dead-reckoning using air data 2017-10-20 14:22:06 +11:00
ChristophTobler
f5fd90533a fix gps and flow flag handling
gps flag was not turning false if there was flow

only reset states if we were relying on that sensor only
2017-10-20 14:22:06 +11: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
6f7f05fdc0 EKF: Move MAG_FUSE_TYPE_AUTOFW control to the expected place 2017-10-12 14:50:23 +11:00
Paul Riseborough
7b4c957ad4 ekf2: Add new mag fusion mode
Adds a mode where mag fusion is only used update the field estimates
2017-10-12 14:50:23 +11:00
Paul Riseborough
1119a9b0ac EKF: Enable optical flow reversion to work if flow data is lost
Also improve reporting.
2017-10-12 08:02:54 +11:00
ChristophTobler
b7e589b98a EKF: only fuse optical flow if terrain is valid 2017-10-10 17:51:56 +02:00