Commit Graph

130 Commits

Author SHA1 Message Date
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
Daniel Agar bd72f3c521 geo std pressure constants and update usage 2018-04-19 08:57:38 +02: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
Carl Olsson f6d23cc621 added rng_stuck to filter control status flags (#392) 2018-03-21 11:46:27 +11:00
Daniel Agar 1bc7378414
EKF decrease synthetic sideslip interval 1s -> 150ms (#407) 2018-03-15 23:09:42 -04: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 2b20c52c4d EKF: Remove redundant code 2017-11-15 22:03:17 +11:00
Paul Riseborough cfdab732d1 EKF: Update parameter description 2017-11-15 21:28:11 +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 929c5c2b37 EKF: enable gps fusion flag to be false while fusing air data 2017-10-20 14:44:37 +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
CarlOlsson 0a7c3ecbc6 EKF: Parameterize maximum angle for rng fusion 2017-09-26 20:53:48 +02: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 f3909244f0 EKF: Correct units in comments 2017-07-25 09:17:18 +10:00
Paul Riseborough aec01ce59c EKF: Update class variable documentation and make compatible with Doxygen 2017-07-20 20:16:42 +10:00
Paul Riseborough d446f66105 EKF: Add a fixed wing mode with setter function 2017-07-08 11:13:40 +02:00
Paul Riseborough 7b5f55303a EKF: Prevent covariance instability in delta velocity bias state estimation 2017-07-03 21:04:07 +10:00
Paul Riseborough eb1e73ec81 Merge pull request #283 from PX4/ekf_matrix_cleanup
EKF matrix typedef cleanup
2017-07-03 21:02:24 +10:00
Paul Riseborough 8e0cd1bc39 EKF: Add parameter to set initial and max allowed wind uncertainty
This enables the initial uncertainty to be set based on application and also ensures that the max allowed growth in wind state variance is consistent with the initial uncertainty specified.
2017-06-30 10:31:16 +10:00
Daniel Agar c44488fdb8
EKF matrix typedef cleanup 2017-06-19 11:10:01 -04:00
ChristophTobler 6f5cffafec fix type of range_aid parameter: int -> int32_t 2017-06-15 10:14:59 +02:00
Roman 39983a7d55 range aid: added hysteresis for switching in and out of range aid
- prevents rapid switching
- added innovation consistency check for using range aid

Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Roman 3778f0921a ekf: enable range finder to be used for estimating height even if it's not
the primary height source

- moved height control into single function in order to decide which sensor
should be used for estimating height
- under certain conditions allow to use the range finder to estimate height
even if it's not the primary height source
- fixed a bug where the delta time for the baro offset calculation was always
zero
- use methods to set height control flags to reduce code duplication and
to prevent bugs

Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Paul Riseborough d6decb3c84 Merge pull request #277 from PX4/pr-ekfBufferParam
EKF: Add a parameter to enable setting of a minimum buffer length
2017-06-15 07:34:21 +10:00
Paul Riseborough c48b879843 Merge pull request #276 from CarlOlsson/feature/only_update_mag_states
EKF: Add feature to use the mag to only update the mag states
2017-06-14 11:04:14 +10:00
CarlOlsson b255d4a53a fixed typos 2017-06-12 18:13:22 +02:00
Paul Riseborough fed4a9bc5a EKF: add vertical position derivative output
Add calculation of a vertical position derivative to the output predictor. This will have degraded tracking relative to the EKF states, but the velocity will be closer to the first derivative of the position and reduce the effect inertial prediction errors on control loops that are operating in a pure velocity feedback mode.
Move calculation of IMU offset angular rate correction out of velocity accessor and into output predictor.
Provide separate accessor for vertical position derivative.
2017-06-12 10:45:46 +10:00
Paul Riseborough 16c7041f4a EKF: Add a parameter to enable setting of a minimum buffer length to handle large sensor timing jitter 2017-06-12 09:33:34 +10:00
Daniel Agar 6ed8512ff4 EKF parameters use int32_t (#279) 2017-06-03 17:16:29 -04:00
CarlOlsson be16406b35 EKF: Add feature to use the mag to only update the mag states 2017-05-26 11:29:21 +02:00
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 9c31632e2b.
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
Paul Riseborough 5ee0ed5a0d EKF: Increase sensitivity and add tuning of bad accel checks 2017-04-29 11:47:38 +02:00
Paul Riseborough 5112ffca90 EKF: Adjust default time delay params and clean up formatting 2017-04-27 07:34:42 +02:00
Daniel Agar 3919d60f66
ekf2 initialization fixes 2017-04-24 18:56:50 -04:00
Paul Riseborough 3758c5a09d EKF: down-sample drag specific force data 2017-04-16 13:07:12 +02:00
Paul Riseborough 5cf31e439d EKF: Add specific drag fusion tuning parameters 2017-04-16 13:07:12 +02:00
Paul Riseborough 465b145929 EKF: Add multi-rotor drag model for wind estimation 2017-04-16 13:07:12 +02:00
Paul Riseborough 7b996c5972 EKF: Increase measurement error allowance for accelerometer clipping 2017-04-07 16:37:27 +10:00
Paul Riseborough f0bbbc8dc6 EKF: Add reporting of bad accel status 2017-04-07 08:47:13 +10:00
Paul Riseborough 2f2ac5be43 EKF: Improve protection against severe IMU accel errors
Use vertical velocity and position innovation failure to detect bad accelerometer data caused by clipping or aliasing which can cause large vertical acceleration errors and loss of height estimation. When bad accel data is detected:

1) Inhibit accelerometer bias learning
2) Force fusion of vertical velocity and height data
3) Increase accelerometer process noise
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 588b27bde7 EKF: inhibit accelerometer bias learning if manoeuvre levels are excessive
This prevents bad scale factors and other errors associated with rapid manoeuvres corrupting the accelerometer bias estimates.
2017-03-10 10:14:06 +01:00
Paul Riseborough 324fe3b0c7 EKF: Add accel bias estimation fault to reporting 2017-03-10 10:14:06 +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