1799 Commits

Author SHA1 Message Date
Daniel Agar
ca4932cfc0 EKF: initialize vertical position and velocity variables
- otherwise checkVerticalAccelerationHealth() can fail if GPS or EV
aren't available to correctly set vertical velocity fusion time and
innovation ratio
2021-07-06 17:11:16 -04:00
Paul Riseborough
0c15624a0c EKF: Fix clang-tidy complaint 2021-07-06 15:20:39 +02:00
Daniel Agar
33bf4e0303 EKF: set uninitialized vel/pos/hgt test ratios to NAN
- ensure valid min is numerically larger than 0 (float32)
2021-06-30 09:30:44 -04:00
Paul Riseborough
3beb5bcbe0 EKF: Fix momentum drag density altitude scaling and update comments 2021-06-22 18:50:56 +10:00
Paul Riseborough
97b5ae1e96 EKF: Fix derivation comments for drag fusion 2021-06-22 18:50:56 +10:00
Paul Riseborough
58d376e2be EKF: prevent /0 and use pre-computed inverses 2021-06-22 18:50:56 +10:00
Paul Riseborough
de8625d255 EKF: fix sign error in bluff body drag fusion 2021-06-22 18:50:56 +10:00
Paul Riseborough
73d1e514d0 EKF: Extend drag fusion to include propeller momnetum drag 2021-06-22 18:50:56 +10:00
BazookaJoe1900
91808f7c9e Update EKF/common.h
Set non-zero default value for airspeed threshold to enable it by default

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2021-06-22 18:30:47 +10:00
Bazooka Joe
9c0a52d52a delay time: potentially reduce delay time if baro/aux velocity/airspeed is not used 2021-06-22 18:30:47 +10:00
bresch
611ace0ed6 EV_yaw: reset ev_to_ekf to identity when yaw is reset to EV
Otherwise, the old rotation matrix is used and not updated anymore
because the EKF is fusing EV yaw data.
2021-06-22 10:25:55 +02:00
bresch
804c3563fb heading_fusion: fix yaw gyro bias oscillation on ground
When the mag is pulled away before takeoff, the EKF can end up learning
a bad yaw gyro bias. This bad gyro bias makes the estimated heading spin
and even if the bias continues to be learned, it can end up being stuck
in limit cycle due to the innovation changing its sign every time the
heading estimate overshoots the measurement.
To prevent this, the Z gyro bias variance is reset when the mag heading
fusion test ratio fails on ground.
2021-06-22 16:45:26 +10:00
bresch
0ef5d7d4c8 test_replay: remove setting read-only parameter 2021-06-16 15:38:17 +02:00
bresch
71fc1b8161 airspeed fusion: use yaw from 312 sequence when pitch is close to 90deg
This caused bad initialization of the wind estimate on tailsitters
2021-05-23 15:58:50 +10:00
Bazooka Joe
e57af44d71 set parameters that doesn't change with const attribute, for clearification 2021-05-20 18:19:33 +10:00
bresch
85f5a935fe [AUTO COMMIT] update change indication 2021-05-12 08:33:07 +10:00
bresch
f7c687e433 GNSS yaw unit test: test fallback to non yaw aiding mode 2021-05-12 08:33:07 +10:00
bresch
a4fe2b1e72 yaw_align: let the mag control logic do the alignement and resets 2021-05-12 08:33:07 +10:00
bresch
2cc023038b mag control: select mag mode before doing the reset 2021-05-12 08:33:07 +10:00
bresch
fe943cf104 mag reset: force align in MC custom mode (aka. indoor mode)
Checking the parameter is enough to decide if we want to force the yaw
alignment or not
2021-05-12 08:33:07 +10:00
bresch
cadcc58415 mag reset: do not stop the fusion from inside the reset function
The start/stop is already handled in the dedicated mag control logic
The early return is not required as this case is handled just below
2021-05-12 08:33:07 +10:00
bresch
6248646bff EV yaw: move EV yaw reset out of resetMagHeading function
Also remove the unnecessary 2nd "manual reset" done in the start function
2021-05-12 08:33:07 +10:00
bresch
48722a2a92 control: inhibit EV yaw from restarting when GPS aid wants to start 2021-05-12 08:33:07 +10:00
bresch
a685987082 GNSS yaw: unset yaw_align if fusion stops before takeoff
We do not want to rely on a potentially badly initialized heading as it
could lead to a flyaway directly after takeoff

Also remove the resetMagHeading() call from the GPS fusion control logic
as this is properly handled in mag_control.
2021-05-12 08:33:07 +10:00
bresch
7ee69706e8 GNSS yaw: add test case when measurement jumps 2021-05-12 08:33:07 +10:00
bresch
7a11871566 GNSS yaw tests: adjust timing
the starting condition needs more than 1 sample to determine if the data
comes regularly

the timeout on "no data" is defined by the fusion reset timeout
parameter (7 seconds)
2021-05-12 08:33:07 +10:00
bresch
51197a5d82 GNSS yaw selection logic refactor 2021-05-12 08:33:07 +10:00
bresch
29243ac5cb yaw_reset: reduce minimum vector length to compute yaw error
A value of 1m/s was too conservative and the EKF takes too much time to
trigger a yaw reset. The value can be safely reduced because the
threshold is computed using the accuracy of the measurement and estimate
before being limited by this value.
2021-05-06 19:13:54 +10:00
Kabir Mohammed
aad48407c2 EKF: increase allowed difference between flow and gyro ODRs
In the normal and lowlight mode for the PAW3902/3 sensor, the ODR is 66Hz, while in super lowlight mode it is 50Hz.

The IMU ODR vs flow ODR mismatch threshold was too conservative for the 66Hz ODR, since https://github.com/PX4/PX4-ECL/pull/928. The EKF would keep waiting for the data to line up and never fuse measurements.
2021-05-03 11:08:16 +02:00
Eike
a7b8afe420
Allow rangefinder fusion in vision height mode (Fix for #994) (#999)
Co-authored-by: Daniel Agar <daniel@agar.ca>
2021-04-30 14:17:39 -04:00
Daniel Agar
4ac57d3bde
EKF: increase fault flags value size to fit current flag bits (> 16) 2021-04-25 17:05:09 -04:00
Eike
5d34d7a24e
Height source vision: Fallback to rangefinder if available (#994) 2021-03-31 14:24:38 +02:00
PX4BuildBot
da06f25216 [AUTO COMMIT] update change indication 2021-03-28 21:22:25 -04:00
PX4 BuildBot
85fcf9393d Update geo_lookup WMM to latest Sun Mar 28 11:48:06 UTC 2021 2021-03-28 21:22:25 -04:00
bresch
6f2dec726a gps sacc: apply same minimum for EKF2 and yaw estimator 2021-03-25 09:54:30 +01:00
Daniel Agar
e3d1ade660 EKF: use flow for vel test ratio if only active source of horizontal aiding 2021-03-23 15:56:22 +01:00
Morten Fyhn Amundsen
bb950a1550 Expose terrain vpos reset counter 2021-03-18 14:25:07 +01:00
Morten Fyhn Amundsen
ab69681744 Add parameter for terrain timeout 2021-03-18 14:25:07 +01:00
Daniel Agar
4df0054873 geo: purge old globallocal_converter 2021-03-15 14:43:53 -04:00
Paul Riseborough
b3c1bd6d40 EKF: Remove un-used code 2021-03-09 21:23:38 +11:00
Paul Riseborough
4bad2a272c EKF: Use debug prints for NuttX builds 2021-03-05 19:06:59 -05:00
Daniel Agar
0f47cae1e1 remove ECL_{INFO,WARN,ERN}_TIMESTAMPED macros
- we already have mechanisms to print these messages timestamped
2021-03-05 19:06:59 -05:00
Paul Riseborough
c1f1415696 EKF: Add usage warning comment 2021-03-05 19:06:59 -05:00
Paul Riseborough
c2b86cdb20 EKF: Provide external reset of event records 2021-03-05 19:06:59 -05:00
Paul Riseborough
9d51ab079a EKF: Remove duplicated event recording 2021-03-05 19:06:59 -05:00
Paul Riseborough
140ca3f48f EKF: Add external monitoring of warning and information events 2021-03-05 19:06:59 -05:00
Paul Riseborough
90a445ddbc EKF: upgrade some events from into to warning status 2021-03-05 19:06:59 -05:00
bresch
cb8367026c [AUTO COMMIT] update change indication 2021-03-04 19:43:01 +11:00
bresch
93dd4e5754 fix unit tests 2021-03-04 19:43:01 +11:00
bresch
5d441d65e1 Accelerate tilt fine alignment by reducing obs noise when at rest
Fine tilt alignment is accomplished by fusing fake position data after
a coarse tilt leveling. The observation noise can be reduced if the
vehicle is at rest to speed up the process.
2021-03-04 19:43:01 +11:00