29 Commits

Author SHA1 Message Date
Daniel Agar
90358f078f add odometry reset counter (ekf2, mavlink, etc) 2022-01-31 09:19:36 -05:00
Daniel Agar
49d9d1c987 ekf2: only set fault status bad_acc_clipping if clipping frequently 2022-01-27 09:59:50 -05:00
Daniel Agar
ae3070bbf1 ekf2: make filter update period configurable
- introduces new parameter EKF2_PREDICT_US to configure the filter
update period in microseconds
 - actual filter update period will be an integer multiple of IMU
2022-01-26 10:57:09 -05:00
Oleg Kalachev
2945ce7c87 ekf2: fuse optical flow when magnetometer is disabled
Co-authored-by: bresch <brescianimathieu@gmail.com>
2022-01-25 15:42:10 +01:00
bresch
1502d77df2 ekf: refactor fake position control logic 2022-01-25 15:07:48 +01:00
bresch
a2260e53da ekf2: replace yaw failure detection criteria
The existing logic using the angle between velocity vectors failed to
determine a yaw failure in practice because the state velocity is often
too small compared to its uncertainty to be used. In all the failures
reported, the yaw emergency estimator converged properly and yaw reset
would have fixed the issue.
A much simpler check using the yaw difference between the main EKF
and the emergency estimator is now used to tell if the vel/pos update
failure is most likely caused by a wrong heading.
2022-01-20 11:54:24 +01:00
Daniel Agar
92a5bbe97f ekf2: improve ring buffer sizing and dynamically allocate 2022-01-19 09:04:53 -05:00
bresch
66290de745 ekf: improve range primary height source
allow range fusion to start with fake measurements if the sensor is
providing bad measurements because too close to the ground
2021-12-10 15:18:10 +01:00
bresch
9147d5ea5c ekf2: use ground as ekf altitude datum when in range primary hgt mode 2021-12-10 15:18:10 +01:00
bresch
5e790da634 ekf2: reset the timeout timer in the reset function directly 2021-12-10 15:18:10 +01:00
bresch
0d874cf00a ekf2: move aiding start details in dedicated function
When an aiding source needs to be started, simply call the corresponding
starting function and any required reset is handled in there.
2021-12-10 15:18:10 +01:00
bresch
c947562183 ekf: get rid of intermediate variable "fuse_height" 2021-12-07 09:16:21 +01:00
bresch
9651f78b0a ekf: centralize the height fusion decision 2021-12-07 09:16:21 +01:00
bresch
d583ef6b79 ekf2: move height fusion code to separate source file 2021-12-07 09:16:21 +01:00
bresch
9e54c6d1aa ekf2: move generic functions to control.cpp
these functions aren't specific to GPS fusion
2021-11-01 13:59:34 +01:00
bresch
8aae39e82a ekf2: move GPS control logic to separate source file 2021-11-01 13:59:34 +01:00
bresch
689ab12845 ekf2: refactor gps vel/pos fusion control logic 2021-11-01 13:59:34 +01:00
bresch
9afc390552 ekf2: move gps yaw reset in starting function 2021-11-01 13:59:34 +01:00
bresch
d0f89f7fff ekf2: refactor wind reset functions 2021-10-26 10:18:56 +02:00
bresch
6e8f0e92ff ekf2: refactor airspeed fusion control logic 2021-10-26 10:18:56 +02:00
Daniel Agar
56823b5ac9 ekf2: EKF control don't allow invalid flow gyro to propagate 2021-10-14 16:31:22 -04:00
Mathieu Bresciani
56b0c46444
ekf2: improve optical flow angular rate compensation 2021-10-12 13:17:29 -04:00
bresch
01d0b8800e commander: report GNSS yaw fault to user 2021-08-05 11:10:02 +02:00
bresch
11cd51c132 EKF: allow emergency reset in GNSS yaw and EV yaw aiding modes 2021-08-05 11:10:02 +02:00
bresch
30c7a596af GNSS yaw: allow unlimited resets on ground 2021-08-05 11:10:02 +02:00
bresch
521b9f5dcc control: do not constantly ask for mag reset if yaw not aligned
This also prevents triggering the `_mag_yaw_reset_req` flag in magless
mode; preventing the GNSS fustion from starting.
2021-07-27 13:34:53 +02:00
bresch
54c7e74de3 EKF: add baro bias estimator using GNSS altitude 2021-07-19 16:53:45 -04:00
Daniel Agar
c8e6d93cc0 ekf2: backend apply code style (generated code still exempt) 2021-07-15 21:15:41 -04:00
Daniel Agar
2cf66a5d8f ekf2: move EKF out of ecl 2021-07-15 10:38:24 -04:00