182 Commits

Author SHA1 Message Date
Daniel Agar
251f1a069b ekf2: update message lost error messages to perf counters
- only allocate these perf counters if data source is present
2021-06-08 20:12:17 -04:00
Daniel Agar
2ccd86102b ekf2: add command line option to manually select instance 2021-06-07 08:47:17 -04:00
Daniel Agar
22838f491a
ekf2: replace mag missed error message with perf count
- this error is primarily useful when significant gaps in magnetometer are present, otherwise the occasional gaps at startup, etc are distracting in regular usage
2021-05-24 20:52:07 -04:00
Julian Oes
29730e30fa ekf2: don't timeout in HITL mode
Otherwise ekf2 might not start if HITL isn't started within 30 seconds.
2021-05-07 22:38:03 -04:00
Beat Küng
38c1ec6a9c ekf2: check if ChangeInstance succeeded 2021-04-27 10:29:09 -04:00
Daniel Agar
2d15c96b9b
ekf2: Multi-EKF let new instance schedule itself immediately on successful init
- this is to minimize missed sensor data (and unnecessary error output) between EKF2 construction and once it actually starts running
2021-04-13 14:24:46 -04:00
Daniel Agar
846695f986 ekf2: replace vehicle_imu lost error message with perf count 2021-03-31 22:07:32 -04:00
Paul Riseborough
4465c4fbf6
ekf2: Publish and log EKF warning and information events (NEW msg estimator_event_flags)
* msg: Add estinator information and warning events message (estimator_event_flags)
 * ekf2: publish information and warning events
 * logger: log estimator_event_flags
 * update ecl submodule to latest

Co-authored-by: Daniel Agar <daniel@agar.ca>
2021-03-07 16:16:48 -05:00
Daniel Agar
263b00b65f
ekf2 support SET_GPS_GLOBAL_ORIGIN and remove globallocalconverter usage
- vehicle_command cmd extended from uint16 to support PX4 internal commands that don't map to mavlink
2021-03-05 18:25:14 -05:00
Daniel Agar
b66a9629e0 ekf2: update to latest ecl with new global origin helpers 2021-02-25 10:43:07 -05: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
5e188b3cd7 ekf2: populate local_position dist_bottom_sensor_bitfield 2021-02-18 10:37:02 -05:00
Daniel Agar
cff7a01d5e
ekf2: estimator_status log reset counts 2021-02-17 21:16:34 -05:00
Daniel Agar
c3172a91d9 ekf2: try reselecting distance_sensor on timeout 2021-02-12 08:25:27 -05:00
bresch
a399bb9894 ekf2: fix mismatch between ecl and firmware flag definition 2021-02-05 14:30:09 +01:00
Daniel Agar
e7f2195a9b ekf2: error if unable to copy every sensor publication 2021-01-29 22:12:29 -05:00
bresch
eaa2ae9dc9 ekf2: add param to enable synthetic mag Z fusion mode 2021-01-17 12:06:59 +01:00
bresch
983234e29d ekf2: add param to set rng check hysteresis 2021-01-17 12:06:59 +01:00
Daniel Agar
48f125f150 estimated IMU bias preflight checks
- commander preflightcheck use estimator_sensor_bias message instead of EKF state index magic number
 - ekf2 publish estimated bias limits in estimator_sensor_bias
 - preflightcheck only error if bias estimate exceeds half of configured limit (delete COM_ARM_EKF_AB and COM_ARM_EKF_GB parameters)
2021-01-12 09:09:42 +01:00
Daniel Agar
abec2bd8df
msg: estimator_status_flags shorten fields
- previously this message exceeded the logger total field length (1500 bytes)
2021-01-11 11:49:51 -05:00
Daniel Agar
662f177830 ekf2: multi instance numbering consistent with uORB publication instances 2021-01-09 13:20:26 -05:00
Daniel Agar
88f8da27ef
save learned mag bias per sensor (Multi-EKF support)
- handle saving the mag bias per sensor (across all estimator instances using that mag) in sensors/vehicle_magnetometer
 - this is now saving back to the actual mag calibration CAL_MAGn_OFF{X,Y,Z}
 - ekf2 reset mag mag bias on any magnetometer or calibration change
 - use Kalman filter scheme to update stored mag bias parameters using all available bias estimates for that sensor

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2021-01-07 09:54:13 -05:00
Paul Riseborough
64ed96bd95
ekf2: Correct airspeed used by EKF for calibration errors 2021-01-05 19:22:53 -05: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
4f62355dec
msg: new estimator_status_flags message for more accessible ekf2 status logging
- log all estimator (ekf2) flags as separate booleans in a new dedicated low rate message (only publishes at 1 Hz or immediately on any change)
 - this is a bit verbose, but it avoids the duplicate bit definitions we currently have across PX4 msgs, ecl analysis script, flight review, and many other custom tools and it's much easier for casual log review in FlightPlot, PlotJuggler, csv, etc
 - for compatibility I've left estimator_status filter_fault_flags, innovation_check_flags, and solution_status_flags in place, but they can gradually be removed as tooling is updated

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2020-12-29 11:27:21 -05:00
bresch
b23d8244f0 ekf2: fix dist bottom constraint 2020-12-16 09:33:38 -05:00
Daniel Agar
d44e537084
ekf2: update to new ecl to fix fault status getter
- estimator_status filter_fault_flags was broken because the union within ecl/EKF has exceeded 16 bits
2020-12-10 12:45:41 -05:00
Daniel Agar
82746af07a
ekf2: use new IMU and mag bias and variance getters in ecl/EKF
- reset IMU bias on calibration change (only works with multi-ekf)
 - standardize PX4_INFO/PX4_WARN/PX4_ERR output for multi-ekf with instance number
 - https://github.com/PX4/PX4-ECL/pull/924
2020-12-08 16:06:18 -05:00
Silvan Fuhrer
59564af860 wind_estimate message: add identifier for source
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-12-08 11:43:27 -05: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
Daniel Agar
01620420fa
ekf2: update to latest ecl with RingBuffer minor improvements
- includes https://github.com/PX4/PX4-ECL/pull/938
2020-12-03 21:17:22 -05:00
Daniel Agar
5d7ea62190 estimator_innovations: remove unimplemented fake vel & pos fields
- easy to readd if and when they're needed
2020-11-11 20:17:52 -05:00
Daniel Agar
1e03285405 ekf2: avoid storing in_ground_effect state 2020-11-11 20:17:52 -05:00
Daniel Agar
26de630dc5 ekf2: remove landed flag and use control_status directly 2020-11-11 20:17:52 -05:00
Daniel Agar
89ab6a5dbf ekf2: preflight checks only reset on STANDBY change
- avoid storing unnecessary state and call setVehicleCanObserveHeadingInFlight() directly
2020-11-11 20:17:52 -05:00
Daniel Agar
b9fff2c221 ekf2: sensor_selection only updated in non-multi mode
- publish attitude as soon as possible
2020-11-11 20:17:52 -05:00
Daniel Agar
7264577eec ekf2: split perf counters (full update or not) and reorganize Run() slightly 2020-11-11 20:17:52 -05:00
Daniel Agar
a68fe4dbd7 ekf2: move parameter update to beginning of cycle 2020-11-11 20:17:52 -05:00
Daniel Agar
5ae7c80a18 ekf2: move rangeSample update to UpdateRangeSample() 2020-11-11 20:17:52 -05:00
Daniel Agar
991015c5c6 ekf2: move magSample update to UpdateMagSample() 2020-11-11 20:17:52 -05:00
Daniel Agar
68f49619b7 ekf2: move gps_message update to UpdateGpsSample() 2020-11-11 20:17:52 -05:00
Daniel Agar
0db706011a ekf2: move FlowSample update to UpdateFlowSample() 2020-11-11 20:17:52 -05:00
Daniel Agar
8ee197acad ekf2: move vehicle_odometry_aligned publication to PublishOdometryAligned() 2020-11-11 20:17:52 -05:00
Daniel Agar
b29f3c7ce5 ekf2: move ExtVisionSample update to UpdateExtVisionSample() 2020-11-11 20:17:52 -05:00
Daniel Agar
0f56793116 ekf2: move BaroSample update to UpdateBaroSample() 2020-11-11 20:17:52 -05:00
Daniel Agar
6b30f01daf ekf2: move AuxVelSample update to UpdateAuxVelSample() 2020-11-11 20:17:52 -05:00
Daniel Agar
651e292d42 ekf2: move AirspeedSample update to UpdateAirspeedSample() 2020-11-11 20:17:52 -05:00
Daniel Agar
f4f3ba47a2 ekf2: move mag calibration to UpdateMagCalibration() 2020-11-11 20:17:52 -05:00
Daniel Agar
96178a6fb0 ekf2: publish yaw estimator status last 2020-11-11 20:17:52 -05:00
Daniel Agar
05de61ff15 ekf2: move estimator innovations publication to method 2020-11-11 20:17:52 -05:00