106 Commits

Author SHA1 Message Date
Paul Riseborough
6847acb72e EKF: Add protection for undefined GPS antenna array heading offset 2018-09-19 06:32:43 +10:00
Paul Riseborough
91f886cb5e EKF: Add support for use of GPS heading data.
Heading data is assumed to be from a  dual antenna array at a specified yaw angle offset in body frame, but with the heading data already corrected for antenna offset. The offset is required to apply the correct compensation for combined rotations and to determine when the yaw observation has become badly conditioned.
2018-09-19 06:32:43 +10:00
Dion Gonano
2354c30d81 Add vision height covariance passthrough (#507)
* Add vision height covariance passthrough

* Fix hgtErr layout
2018-09-11 06:36:13 +10:00
Paul Riseborough
b861594d0b EKF: enable optical flow use to bootstrap 2018-09-01 14:49:45 +02:00
Kabir Mohammed
a6a1edbe3f EKF : Fix type of flow data navigation variable (#499) 2018-08-30 18:26:17 +10:00
Paul Riseborough
a53ad9c261 EKF: Add missing optical flow ground motion protection
Motion compensated optical flow rates are supposed to be zeroed if reported flow quality is below the minimum threshold value when on ground.
The comments and logic have been amended to be consistent and make the design intent clearer.
2018-08-28 21:31:50 +02:00
Roman Bapst
ee85a29202 Pr opt flow (#482)
* optical flow: fixed calculation of velocity of the flow sensor relative to
the IMU

- gyroXYZ holds a delta angle and first needs to converted to a gyro rate

Signed-off-by: Roman <bapstroman@gmail.com>

* optical flow: calculate height above the ground with respect to the flow
camera
- the flow camera can be offset from the IMU which needs to be considered

Signed-off-by: Roman <bapstroman@gmail.com>

* estimator interface: fixed comment regarding optical flow sample timestamp

- the timestamp on an optical flow sample corresponds to the trailing
edge of the flow integration period

Signed-off-by: Roman <bapstroman@gmail.com>
2018-07-16 11:41:35 +10:00
Daniel Agar
cebdc3d829 ekf run output predictor immediately with new IMU data (#471)
* EKF collect_imu take const imu sample and populate buffer

* EKF calculateOutputStates cleanup

* EKF add calculate_quaternion output predictor method

* EKF: update documentation

* EKF: remove unnecessary getter function

* EKF calculateOutputStates only apply dt correction to bias

* EKF pytest assert attitude validity, not update() return

* EKF: correct documentation

* EKF: Do not make attitude validity dependent on yaw alignment status

Yaw alignment could fail in flight due to temporary loss of data and yet the quaternions would still usable for stabilisation even though the absolute earth yaw angle wrt true north was uncertain.
2018-07-05 07:59:35 +10:00
Paul Riseborough
c6ed2ccfcd EKF: Fix half frame offset in flow gyro compensation.
The gyro data accumulation needs to be across the same integration period as the flow sensor. The previous code didn't sample the accumulation until the midpoint of the flow data had fallen behind the fusion time horizon.

This PR changes the optical flow time stamp definition so that flow data is retrieved when the leading edge of the flow accumulation period falls behind the fusion time horizon. This enables the accumulated gyro data to be sampled at the correct time. Fusion is then delayed until the mid sample time has fallen behind the fusion time horizon.
2018-06-13 16:51:42 +10:00
Paul Riseborough
de7c9d85a4 EKF: Handle flow data without valid gyro data 2018-06-12 16:24:25 +10:00
Mohammed Kabir
b4d2b8c57d EKF : introduce new architechture for navigation limits 2018-06-09 22:23:55 +02:00
Paul Riseborough
1562a82dc2 EKF: Add parameter to adjust on-ground movement detector sensitivity 2018-06-09 22:23:55 +02:00
Paul Riseborough
e10798bfdf EKF: Add on ground movement detector 2018-06-09 22:23:55 +02:00
Paul Riseborough
6cadc92285 EKF: Don't reject saturated flow data when it is the only aiding source 2018-05-10 07:11:59 +10:00
Daniel Agar
c5b2f59f57 PX4 style fixes (excluding EKF generated code) 2018-05-03 22:25:36 -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
Daniel Agar
cd12f049fe move geo and geo_lookup from PX4 Firmware to ECL 2018-03-26 21:52:11 -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
Daniel Agar
d9c8af54bd
EKF add print_status() with memory usage 2017-11-16 14:11:34 -05:00
Daniel Agar
75d1ed894c
EKF simplify RingBuffer allocation check 2017-11-16 13:09:17 -05:00
Paul Riseborough
af7004ef01 EKF: report observation buffer allocation errors 2017-11-16 20:04:46 +11:00
Paul Riseborough
d785a19c0a EKF: delay final allocation of observation buffers until required 2017-11-16 19:47:04 +11:00
Daniel Agar
ed9a394029
EKF RingBuffer avoid copying 2017-11-15 18:08:51 -05: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
ChristophTobler
cdf6e6cd36 EKF: use delta_time to avoid division by zero 2017-10-11 15:15:06 +02:00
Paul Riseborough
d293c4231d EKF: Protect against divide by zero caused by invalid optical flow 2017-10-11 21:54:47 +11:00
Paul Riseborough
ab9b8e1964 EKF: Prevent bad optical flow quality causing loss of aiding when on ground 2017-10-11 21:22:33 +11:00
ChristophTobler
81a64c0479 ekf: fix flow direction when on ground 2017-10-10 14:39:44 +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
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
87fdee440b EKF estimator_interface coverity fix 139419 2017-04-29 11:48:15 +02:00
Daniel Agar
b3f8fd19e0 EKF estimator_interface coverity fix 140490, 140491 2017-04-29 11:48:15 +02:00
Daniel Agar
3919d60f66
ekf2 initialization fixes 2017-04-24 18:56:50 -04:00
Paul Riseborough
c3f966f53e EKF: remove clang build error message 2017-04-18 19:22:59 +10:00
Paul Riseborough
c607941e2f EKF: Allow external setting of air density for multi-rotor drag fusion 2017-04-16 13:07:12 +02:00
Paul Riseborough
3758c5a09d EKF: down-sample drag specific force data 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
0d7e7e9d81 EKF: Don't use EKF origin in GPS drift check calculation
The GPS drift calculations need to be able to run independently of the EKF origin.
2017-04-12 13:11:34 +02:00
Paul Riseborough
2426f1dd3a EKF: remove use of memset to initialise variable
When using a union of flags and integer value it is safer to initialise the value to 0 rather than memset the flags because the flags may not define all bits in the integer.
2017-03-21 07:57:23 +11: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
9bb54ccc08 EKF: don't accept GPS data without a 3D lock 2017-03-10 10:15:53 +01:00
Paul Riseborough
af26ade1ce EKF: Use norm for vector length everywhere 2017-02-22 14:12:05 +01:00
Paul Riseborough
6e5a9aabe1 Merge pull request #234 from PX4/pr-optFlowUpdates
EKF: optical flow improvements
2017-02-22 09:00:48 +11: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
Paul Riseborough
bcf7cac5d9 EKF: remove hardcoded limit on optical flow time delta
Allow for up to 50% lost data.
2017-01-18 06:06:45 +11:00
Paul Riseborough
3fb7effb0c EKF: Allow optical flow use when on-ground with poor data quality 2017-01-18 06:06:45 +11:00
Lorenz Meier
453bde73f8 ECL: Simplify / correct estimator interface 2017-01-15 10:17:41 +01:00
Roman
c5a55d97aa initialise data members properly
- dot not use memset for struct with non POD types

Signed-off-by: Roman <bapstroman@gmail.com>
2017-01-15 10:02:31 +01:00