21 Commits

Author SHA1 Message Date
Daniel Agar
3fba7288af ekf2: selector use hysteresis for healthy flag
- require that an instance is healthy continuously for >= 1s before
allowing it to be used
2021-12-14 09:52:36 -05:00
Daniel Agar
b7efd4f947
ekf2: selector treat combined test ratio > 1 as a warning
* ekf2: selector treat combined test ratio > 1 as a warning
* ekf2: wait for 1s of constant warning to trigger an instance switch

Co-authored-by: bresch <brescianimathieu@gmail.com>
2021-12-01 20:22:34 -05:00
bresch
fc155bc57e Ekf2Selector: declare filter unhealthy when high test ratio
Request a switch to another instance when the combined test ratio is too high.
2021-11-18 13:29:01 +01:00
Daniel Agar
c39a21aa54 ekf2: selector remove special timeout condition
- this mainly produces false positives when disarmed and bench testing
2021-09-29 09:59:08 -04:00
Daniel Agar
982692f5ed ekf2: selector handle NAN test ratios as uninitilaized
- requires https://github.com/PX4/PX4-ECL/pull/1020
2021-06-29 21:36:24 -04:00
David Sidrane
9a423e222b ekf2:Use inttypes and fix types 2021-06-16 17:07:47 +02:00
Daniel Agar
578c003c13 ekf2: selector handle uninitalized test ratios
- choose the best instance regardless of tilt or yaw alignment
2021-06-07 08:56:37 -04:00
Daniel Agar
2ccd86102b ekf2: add command line option to manually select instance 2021-06-07 08:47:17 -04:00
Daniel Agar
f15eefcc95 ekf2: selector increase status rate before potential instance change 2021-05-07 22:38:47 -04:00
Daniel Agar
b1ebd16c61
ekf2: improve selector reset handling
- handle reset count rollover (uint8_t)
 - compute full reset delta if primary estimator instance has changed or if we missed a reset
2021-05-05 21:45:13 -04:00
Silvan Fuhrer
0ea8104344
select single system-wide wind estimate message (current best)
- publish wind estimate only from EKF, and wind speeds from airspeed selector to new separate topic (airspeed_wind)
 - rename message wind_estimate to wind
 - publish wind from currently used ekf instance (ekf2selector)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-02-20 13:15:01 -05:00
Daniel Agar
40a452dcd2 ekf2: selector improve timeout handling and reporting
- relax estimator_status timeout unless attitude hasn't published recently
2021-02-14 21:08:56 -05:00
이충경
17ea6f68e2 fix variable name in EKF2Selector (#16621) 2021-01-22 15:32:32 +01:00
Daniel Agar
04f9ada500
ekf2: selector improve fallback selection when the primary becomes unhealthy
- if an ekf instance becomes unhealthy prefer switching to the next best healthy instance on a different IMU
2021-01-11 09:38:26 -05:00
Daniel Agar
f73d93ef6c ekf2: selector improve status reporting
- publish estimator_selector_status at minimal rate or immediately on change
 - log all estimator_selector_status updates
2021-01-10 19:25:53 +01:00
Daniel Agar
98cff94702 px4_work_queue: directly support SITL lockstep
- the purpose is to ensure that every WorkItem (and WorkItems scheduled
by WorkItems) is allowed to run to completion every step
 - per workqueue register a lockstep component whenever a work item is
added (if not already registered)
 - once the work queue is empty unregister component
2021-01-04 09:38:05 +01:00
Daniel Agar
681590c510
ekf2: multi-ekf force initial selection (and sensor_selection publication)
- depending on the particular sensor configuration and startup timing we were getting an initial sensor_selection publication without valid accel & gyro device ids (only applies to Multi-EKF)
 - fix faulty accel and gyro device ids
 - initialize unused test ratio fields to NAN for logging clarity
2020-12-07 21:37:24 -05:00
Paul Riseborough
3e4c38f6e8 ekf2: Fix bug causing excessive lane selection switching 2020-11-25 10:00:07 -05:00
Daniel Agar
2c874f1cd9 ekf2 selector fix SITL lockstep
- ekf2 selector don't register lockstep until first attitude publication
 - sensors module register lockstep component
 - enable multi-EKF2 in SITL
2020-10-28 09:42:41 -04:00
Daniel Agar
df2f26ebdf
rename vehicle_visual_odometry_aligned -> estimator_visual_odometry_aligned
- saves a small amount of work for the ekf2 selector in multi-EKF mode (visual_odometry_aligned now ignored)
 - helps to distinguish the origin/purpose from vehicle_odometry and vehicle_visual_odometry
2020-10-27 12:33:39 -04:00
Daniel Agar
0f411d6820
Multi-EKF support (ekf2)
- ekf2 can now run in multi-instance mode (currently up to 9 instances)
    - in multi mode all estimates are published to alternate topics (eg estimator_attitude instead of vehicle_attitude)
 - new ekf2 selector runs in multi-instance mode to monitor and compare all instances, selecting a primary (eg N x estimator_attitude => vehicle_attitude)
 - sensors module accel & gyro inconsistency checks are now relative to the mean of all instances, rather than the current primary (when active ekf2 selector is responsible for choosing primary accel & gyro)
 - existing consumers of estimator_status must check estimator_selector_status to select current primary instance status
 - ekf2 single instance mode is still fully supported and the default

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2020-10-27 10:56:11 -04:00