146 Commits

Author SHA1 Message Date
kamilritz
f3d790a664 Update optical flow interface 2020-01-24 16:18:42 +03:00
RomanBapst
cafb1400fb estimator_interface: bugfix, set range sample correctly
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2020-01-24 13:03:04 +01:00
kamilritz
de33885658 Update setExtVisionData interface 2020-01-23 14:50:43 +01:00
kamilritz
37201fb071 Remove legacy imu interface 2020-01-23 09:34:07 +11:00
kamilritz
7c3a2f839b Update range finder interface 2020-01-23 09:34:07 +11:00
kamilritz
4fb2d1b02e Update range finder interface 2020-01-23 09:34:07 +11:00
kamilritz
9f0d8ed59e Update mag interface 2020-01-23 09:34:07 +11:00
kamilritz
856961ba85 Update airspeed interface 2020-01-23 09:34:07 +11:00
kamilritz
b8a3ed5f09 Update baro interface 2020-01-23 09:34:07 +11:00
kamilritz
74ec80cdc7 Update gps interface 2020-01-23 09:34:07 +11:00
kamilritz
83b2abe434 protect against overflow 2020-01-21 10:09:48 +03:00
kamilritz
4be9ae8029 Compute the timestamp of average sample correctly 2020-01-21 10:09:48 +03:00
kamilritz
29c5954690 Move baro downsampling and dynamic pressure comp to ECL 2020-01-21 10:09:48 +03:00
kamilritz
d7d7b56519 Move mag down sampling to ECL lib 2020-01-21 09:36:02 +03:00
kamilritz
be11516dd6 Refactor IMU downsampling into its own class 2020-01-09 19:43:29 +11:00
kamilritz
c7e074276f Save flash space
This commit saves roughly 400-500 Bytes in flash space
2020-01-09 19:43:29 +11:00
kamilritz
84dcb32bd8 Extend auxVel interface to support 3d velocity 2020-01-08 14:36:03 +01:00
kamilritz
07e8e88e88 Support full vision variance 2020-01-08 14:36:03 +01:00
kamilritz
1fcfd394dd Various small non-functional improvements 2020-01-08 09:00:31 +01:00
kamilritz
0b18143745 Improve readibility 2020-01-08 09:00:31 +01:00
kamilritz
3daf25763e Remove unnecessary comments 2020-01-08 09:00:31 +01:00
kamilritz
36da8d82c8 Clean up white space 2020-01-08 09:00:31 +01:00
kamilritz
9e6d27fafb Add missing const qualifier 2020-01-08 09:00:31 +01:00
kritz
532c9abd4a Expand test framework and test cases (#685)
* Fix comment

* Ekf wrapper for testing

Add utility function for accessing information in the ekf object

* Add step function for Gps sensor

* Add RangeFinder and Flow to simulated sensors

* Add first fusion logic tests

* Add units to function name

* Use EXPECT_TRUE

* Adding missing qualifiers

* Improve EXPECT_ calls

* Improve naming
2019-12-17 11:35:45 +01:00
kritz
6c25ac5731 Tilt Initialisation: Average Filter -> LowPass Filter (#686)
* Tilt Initialisation: Average Filter -> LowPass Filter

* Add _is_first_imu_sample variable

* Remove not needed comments
2019-12-17 11:01:25 +01:00
Daniel Agar
98a1aae494 EKF: use Matrix cross product 2019-12-17 09:35:08 +01:00
kamilritz
1bf09fd370 Remove EKF prefix from logged messages 2019-12-12 08:48:10 +01:00
kritz
4a38f5a2f6 Add timestamp to ECL print statements, (#644)
which is helpful for EKF replay debugging.
2019-09-25 11:24:42 +02:00
kamilritz
fd6b364c11 posNED to pos and velNED to vel and add ev vel covariances to reset 2019-09-24 07:48:46 +10:00
kamilritz
1e57c4bbec Fix white space 2019-09-24 07:48:46 +10:00
kamilritz
4511b9ff5e Add missing checks for flags.ev_vel 2019-09-24 07:48:46 +10:00
kamilritz
149233a9ab Add velocity observations to external vision interface 2019-09-24 07:48:46 +10:00
Nico van Duijn
640e41cba7 EKF: change rangeSample quality to int8_t 2019-09-12 17:45:37 +10:00
Nico van Duijn
a12186c285 terrain_estimator: introduce quality metric in rng
This commit introduces a quality measure in the range data. It is
used to properly decide whether to initialize the HAGL estimate on
 sensor data or MIN_HGT parameter, as well as in the decision of
whether a 'fake' measurement should be published on the ground to
allow for optical flow take-offs.
2019-09-12 17:45:37 +10:00
Carl Olsson
f0889c1760 EKF: fixed some comment typos
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-18 10:20:33 -04:00
Daniel Agar
c66f7f4a09 EKF drop unused timestamp from collect_gps() and pass data by const reference 2019-03-05 17:26:19 -05:00
Daniel Agar
a5e6191ba7 EKF add clarity brackets to avoid potential confusion
- fixes https://github.com/PX4/ecl/issues/555
2019-01-30 09:15:53 -05:00
Anna Dai
721f5e61a5 increase optical flow buffer to imu buffer length 2019-01-17 10:23:15 +11:00
Daniel Agar
8bbaf898a5
EKF add new simple setIMUData() interface (#512) 2018-10-17 15:30:25 -04:00
Paul Riseborough
e6cd6eff87 EKF: Fix bug preventing use of flow sensors without gyros
The handling of invalid flow data when on ground is performed in controlOpticalFlowFusion() where it is able to handle flow sensors that don't publish gyro data.
2018-10-11 07:12:54 +11:00
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