593 Commits

Author SHA1 Message Date
Beat Küng
4ba84d56c9 logger: introduce optional topics
The current practice of adding topics to the default set isn't scalable,
as it affects all setups.
By making sure topics are advertised on init, logger can just discard
topics that don't exist. This does not work for all topics, so topics are
specifically marked as optional. It can be extended to more topics later
on though.

This reduces the list of topics by ~35 on a pixracer configured as quad,
and reduces RAM usage by ~1KB.
2021-11-15 09:02:03 -05:00
Daniel Agar
68026eadeb
save significant IMU bias changes learned by the EKF
* ekf2: make publishing of learned accel biases more robust
* ekf2: reset accel bias if calibration updated
* msg: add separate accel and gyro calibration counters
* ekf2: use separate accel and gyro calibration counters
* ekf2: rework logic to reset biases when calibration counters increment
* sensors: add saving of learned accel biases
* ekf2: generalized saving accel/gyro/mag in flight sensor calibration
* boards: holybro kakutef7 disable systemcmds/perf and systemcmds/top to save flash

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2021-11-07 15:34:27 -05:00
Daniel Agar
fec0d6c5ed ekf2: change indication further reduce data precision 2021-11-02 10:21:54 +01:00
bresch
1317b1a6e1 [AUTO COMMIT] update change indication 2021-11-01 13:59:34 +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
e90734881b ekf2_test: add more GPS fusion control tests 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
dagar
a2801bab80 [AUTO COMMIT] update change indication 2021-10-26 14:39:58 -04:00
bresch
d0f89f7fff ekf2: refactor wind reset functions 2021-10-26 10:18:56 +02:00
bresch
456dfcb4b9 ekf2: update getter for true airspeed 2021-10-26 10:18:56 +02:00
bresch
3927c183de ekf2_test: adjust airspeed unit test
an airpseed of > 2m/s is required to start the fusion (set by param)
fw mode is also required

Given the larger estimated windspeed after those changes, the change of
static pressure is larger and the height estimate takes more time to
reach the final value
2021-10-26 10:18:56 +02:00
bresch
6e8f0e92ff ekf2: refactor airspeed fusion control logic 2021-10-26 10:18:56 +02:00
bresch
8873e92c7c ekf: force fallback to baro if GPS is stopped while in GPS height mode
Otherwise, no height aiding source is used
2021-10-26 10:05:28 +02:00
bresch
0a140ec59a ekf2_test: add GPS height to baro fallback 2021-10-26 10:05:28 +02:00
bresch
f4c21cedd9 ekf2_test: use motion_planning for dynamic yaw emergency test 2021-10-25 18:06:38 -04:00
bresch
340a2caa8e ekf2_test: use motion_planning library
The VelocitySmoothing class from the motion_planning library is used to
generate trajectories in order to test the EKF convergence during motion
2021-10-25 18:06:38 -04:00
mcsauder
21163d859e Whitespace cleanup. 2021-10-19 13:29:26 -04:00
Daniel Agar
4cf8eb8226 ekf2: EKF vehicle_at_rest always require some rotation in addition to vibration metrics 2021-10-18 21:39:40 -04: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
Shubham Shah
c92cd65831 Update EKF2.cpp 2021-10-09 19:39:43 -04:00
Peter van der Perk
d5e3e9a7bc [Kconfig] Decompose Kconfig, now each module has its own Kconfig
Which is better for versioning and decomposability
2021-10-07 10:09:01 -04:00
Daniel Agar
ddd1dea4f0
ekf2: avoid uint64 timestamp conversion to float 2021-10-06 09:27:06 -04: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
Paul Riseborough
ed7c5991eb ekf2: Fix dimensional error in gyro and accel bias variance conversions 2021-09-29 09:58:41 -04:00
Daniel Agar
2b1c97eb37
Update world_magnetic_model to latest Sun Aug 22 11:14:24 UTC 2021 2021-08-22 16:28:00 -04:00
Daniel Agar
06c2d14903 ekf2: multi-mode allow first instance to save EKF2_MAG_DECL 2021-08-19 10:14:35 +02:00
David Sidrane
e8c418caaf EKF:Use inttypes 2021-08-13 14:22:00 -04:00
Daniel Agar
fb4ac0f08c ekf2: remove redundant IMU vibration metrics
- consume IMU vibration metrics from vehicle_imu_status
2021-08-08 06:26:03 -07:00
bresch
01d0b8800e commander: report GNSS yaw fault to user 2021-08-05 11:10:02 +02:00
bresch
44219e9f45 EKF: add GNSS yaw to emergency yaw fallback test 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
4ebfbc6eab GNSS yaw: use NIS sequence to detect bias in state
A constant large value in the (signed) normalized innovation test ratio is a sign
of bias in the state estimate. This metric can be used to trigger a
covariance boost or reset
2021-08-05 11:10:02 +02:00
bresch
3fe04a91f6 GNSS yaw: add observation jump on ground
Some receivers are initializing to some heading and then resetting to
the correct one after a couple of seconds. EKF2 should detect that and
reset to the new value
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
e90e1c7e2a GNSS yaw: use dedicated observation noise 2021-08-05 11:10:02 +02:00
Daniel Agar
93aa6e3f78 ekf2: baro bias publish minor cleanup
- naming consistency (estimator prefix as "namespace")
 - only publish if baro is available and bias is changing as a small logging optimization
 - avoid unnecessary copying (get const reference to status directly)
 - trivial code style fixes
2021-08-02 13:59:38 -04:00
David Jablonski
9c36236565 ekf2: increase stack size to 3600 2021-08-02 09:47:38 -04:00
Daniel Agar
54918f650b
Update world_magnetic_model to latest Sun Aug 1 16:57:37 UTC 2021 2021-08-01 13:53:53 -04: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
639e0a39cf EKF2: add yaw estimator alignment test 2021-07-27 13:34:53 +02:00
Mathieu Bresciani
17ebcd2456
mag_control: fuse fake heading during leveling fine alignment (#17964)
Co-authored-by: Daniel Agar <daniel@agar.ca>
2021-07-27 11:50:50 +02:00
Daniel Agar
e01b631465 ekf2: change indication test limit float precision to minimize false positives 2021-07-26 13:54:36 -04:00
dagar
a8e3c46cdb [AUTO COMMIT] update change indication 2021-07-19 16:53:45 -04:00
bresch
54c7e74de3 EKF: add baro bias estimator using GNSS altitude 2021-07-19 16:53:45 -04:00
Daniel Agar
10f4fc7783 ekf2: don't print distance_sensor selection unless there are multiple options 2021-07-19 12:17:12 -04:00
Daniel Agar
0101934f47 ekf2: multi-EKF instance message INFO -> DEBUG 2021-07-18 18:02:33 -04:00
Daniel Agar
9ac860ac33 ekf2: test fix double promotion warnings 2021-07-18 15:49:53 -04:00