269 Commits

Author SHA1 Message Date
bresch
b38458c2ab Terrain estimator: formatting and remove redundant comments 2019-10-22 20:19:56 +11:00
bresch
e09e3e17a1 control: rename _range_aid_enabled to _is_range_aid_suitable
rename rangeAidConditionsMet to checkRangeAidSuitability
2019-10-15 11:10:36 +02:00
bresch
fac69d07a3 control: refactor rangeAidConditionsMet function 2019-10-15 11:10:36 +02:00
Paul Riseborough
eae6e8f19c EKF: Fix on ground yaw drift when using EKF2_MAG_TYPE = 4 2019-10-08 20:08:42 +11:00
RomanBapst
4e946d5bcb implemented synthesized magnetometer Z measurement
- calculate a theoretical value based on the knowledge of the direction
and strength of the magnetic field vector and X/Y sensor measurements
- needs knowledge about location on earth to work
2019-10-08 20:02:16 +11:00
kritz
4a38f5a2f6 Add timestamp to ECL print statements, (#644)
which is helpful for EKF replay debugging.
2019-09-25 11:24:42 +02:00
kamilritz
83eb326076 Missing posNED 2019-09-24 07:48:46 +10:00
kamilritz
4f6ca3a74c Replace rest of spaces with tabs 2019-09-24 07:48:46 +10:00
kamilritz
4511b9ff5e Add missing checks for flags.ev_vel 2019-09-24 07:48:46 +10:00
kamilritz
e7d927c899 Stop using bad GPS when we have vision velocity 2019-09-24 07:48:46 +10:00
kamilritz
4b30de587f Make vel_pos innov gate variable name clearer 2019-09-24 07:48:46 +10:00
kamilritz
4237d7ccd7 Improve external vision position fusion 2019-09-24 07:48:46 +10:00
kamilritz
3e8139ff9f Enable vision velocity fusion 2019-09-24 07:48:46 +10:00
Andreas Antener
4f19d457c4 ekf, control: make sure mag fusion doesn't start anymore when we have GPS heading fusion active 2019-09-18 09:27:24 +10:00
Jan Brehmer
93eb1266f6 EKF: reset position when stopping GPS use and EV is active 2019-09-18 08:33:40 +10:00
Nico van Duijn
933189eac0 EKF: fix rng_faulty flag when sensor is stuck 2019-09-12 17:45:37 +10:00
Nico van Duijn
a12186c285 terrain_estimator: introduce quality metric in rng
This commit introduces a quality measure in the range data. It is
used to properly decide whether to initialize the HAGL estimate on
 sensor data or MIN_HGT parameter, as well as in the decision of
whether a 'fake' measurement should be published on the ground to
allow for optical flow take-offs.
2019-09-12 17:45:37 +10:00
bresch
3b32ee4166 Flow aiding - Reset state when flow is enabled only if it is the only
position/velocity aiding sensor.
Until now, it was alway resetting if the vehicle does not have gps or
external vision. This caused a reset/glitch at every stop (when range data gets
valid)
2019-09-03 09:58:33 +02:00
kamilritz
933c32c921 Enable local frame alignment also without using it 2019-08-29 08:34:10 +10:00
Paul Riseborough
a036cf82cc EKF: Remove use of of quaternion self product operator and fix delta rotation sign 2019-06-17 19:24:55 +10:00
Paul Riseborough
7612fa40ed EKF: Don't start using GPS for height until all validity checks have passed
Consolidate intermittent data checks, improve variable and clarify usage.
2019-06-13 19:36:37 +10:00
Roman
c085d7295d addressed review comments 2019-05-15 17:16:36 +10:00
Roman
fbb51147b7 implemented use of optical flow for terrain estimation
Signed-off-by: Roman <bapstroman@gmail.com>
2019-05-15 17:16:36 +10:00
Mohammed Kabir
3f691891c4 EKF: control: stop vision yaw fusion on timeout 2019-04-22 12:56:24 +10:00
Martina
c4492b17c1 do not reset yaw if vehicle on ground 2019-04-09 20:50:37 +10:00
Paul Riseborough
f97f0b6ea3 EKF: Remove unnecessary code
_flt_mag_align_start_time is set on initial alignment and will always be >0 before this check can run
2019-04-08 06:57:17 +10:00
Paul Riseborough
43b5e26fe4 EKF: Fix bug causing continual yaw reset when EKF2_MAG_TYPE = 2 2019-04-08 06:57:17 +10:00
Roman
f95cd4b358 ground effect: removed dependency on local position
Signed-off-by: Roman <bapstroman@gmail.com>
2019-03-19 13:14:57 +11:00
CarlOlsson
938c8ad9ad EKF: use hagl estimate if valid for when to trigger yaw reset on takeoff 2019-03-19 13:04:54 +11:00
Carl Olsson
f0889c1760 EKF: fixed some comment typos
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-18 10:20:33 -04:00
CarlOlsson
2b17ced405 EKF: Clean up use of magnetometer declination. Before the innovation was not zero in fuseDeclination()
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-13 08:14:23 +11:00
Paul Riseborough
dd58e69549 EKF: Ensure FW yaw alignment method is used on first in-air reset 2019-01-31 09:53:57 -05:00
Paul Riseborough
fe378fd761 EKF: Prevent unwanted declination fusion when re-starting 3-axis fusion 2019-01-31 09:53:57 -05:00
Paul Riseborough
bd1647a7fb EKF: Rework use of fuseDeclination()
Simplify calling so that it is only called in two ways:
1) Immediately before 3-axis mag fusion if not called since the last earth field covariance reset so that the earth field declination information can be formed.
2) Immediately after 3-axis mag fusion otherwise.
2019-01-31 09:53:57 -05:00
Paul Riseborough
d52f53635b EKF: Save mag field covariance data before reset 2019-01-31 09:53:57 -05:00
Paul Riseborough
708c79eb8f EKF: Ensure mag field state covariance data is always available for re-use
Prevents use of  _saved_mag_ef_covmat and _saved_mag_bf_variance before being initialised or when stale.
2019-01-31 09:53:57 -05:00
Paul Riseborough
8839e4e1f4 EKF: Don't discard declination certainty information when resuming 3-axis fusion.
In the case where the EKF is switching between 3-axis and heading fusion, off-diagonal elements containing the correlation between N,E  components of the earth field were being lost on each switch event. These elements contained information about the declination uncertainty and should be preserved.
2019-01-31 09:53:57 -05:00
Paul Riseborough
25148e1b45 EKF: Prevent rapid changes in declination estimate after a reset
Ensures that each time the earth field covariance and variance data is reset, that the off-diagonal elements containing earth field declination angle certainty is restored.
2019-01-31 09:53:57 -05:00
Paul Riseborough
4b3140e5f7 EKF: Fix rebase error 2019-01-31 09:53:57 -05:00
Paul Riseborough
a0b9cb002e EKF: Use consistent method for recording completion of in-flight yaw alignment 2019-01-31 09:53:57 -05:00
Paul Riseborough
ef5a87c1d4 EKF: Rework quaternion yaw reset.
Use a new method that preserves the roll and pitch information and adds the uncertainty for yaw only.
Ensure that correlation information to non-quaternion states is removed when a reset occurs to prevent fusion of subsequent observations (e.g. GPS) causing incorrect yaw.
2019-01-31 09:53:57 -05:00
Daniel Agar
a5e6191ba7 EKF add clarity brackets to avoid potential confusion
- fixes https://github.com/PX4/ecl/issues/555
2019-01-30 09:15:53 -05:00
Anna Dai
44200e9649 add GPS drop out case to GPS fusion logic
EKF waits 10s after GPS signal is lost before setting GPS control status flag to false. As the position information given by the alternative position sources drifts from the last GPS position, the controller over corrects.
With this update, the time horizon until GPS control flag set to false is reduced and only alternative position source is used for estimation.

tested with optical flow as position souce

log from as is https://review.px4.io/plot_app?log=d624af5e-dde4-40ab-ba5b-a693a49f5a36

log with update https://review.px4.io/plot_app?log=13ed6dc3-22dd-43f8-b898-4add41d60439
2019-01-17 10:23:15 +11:00
CarlOlsson
490888285d EKF: Remove flag prefix
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-01-13 23:48:46 +01:00
CarlOlsson
d223680197 EKF: add flt_mag_align_complete to control_status flags
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-01-13 23:48:46 +01:00
Paul Riseborough
48d83f3bcb EKF: Fix vulnerability to ground level mag anomally when using heading fusion (#544)
Previously, the reset of the yaw when climbing above 1.5m was not performed until 3-axis fusion was enabled. This could result in loss of navigation depending on the value of  EKF2_MAG_TYPE and the flight profile.
2019-01-03 09:41:55 -05:00
Paul Riseborough
4657a9cd21 EKF: Ensure yaw gets reset when declination is set 2018-11-15 07:16:31 +11:00
Roman
68a3cbc368 addressed review comment
Signed-off-by: Roman <bapstroman@gmail.com>
2018-11-13 08:42:28 +11:00
Roman
a74b7ef60b 3D only mag fusion: make sure _flt_mag_align_complete is set
- _flt_mag_align_complete was not set when choosing pure 3D mag fusion.
one effect of this was that the declination used in the filter was not
the one calculated from the magnetic field states.

Signed-off-by: Roman <bapstroman@gmail.com>
2018-11-13 08:42:28 +11:00
jie.zhang
10a0fef7b7 EKF/control: remove unnecessary yaw_align update 2018-10-17 15:50:00 -04:00