Commit Graph

1376 Commits

Author SHA1 Message Date
kamilritz 4bc6ae69ae Remove if statement that can not be entered 2019-12-11 17:23:45 +02:00
kamilritz 6941777e17 Remove obsolete vision sample counter during initialization 2019-12-11 17:23:45 +02:00
kamilritz 181303488c Log height innovation sensor specific 2019-12-05 20:09:34 +11:00
kamilritz f32fce28a3 Fix gps vertical observation variance 2019-12-05 20:09:34 +11:00
kamilritz ecd199d5d0 Fix vel pos test ratio 2019-12-05 20:09:34 +11:00
kamilritz 2df2dede2f Fix variance vs stdDev bug
(cherry picked from commit 0faea89da2a3326d070a6ecca93ec52ec3e29591)
2019-12-05 20:09:34 +11:00
kamilritz 3923c5fecb Add get*innovation* functions as overide 2019-12-05 20:09:34 +11:00
kamilritz 07e804676c Rename IMU biases 2019-12-05 20:09:34 +11:00
kamilritz dae8c2f8dc Group velocity and position as a 3d vector 2019-12-05 20:09:34 +11:00
kamilritz beedf1ce4f Add print statement to reset vel or pos function 2019-12-05 20:09:34 +11:00
kamilritz 5c038a3b43 Add stop*Fusion function 2019-12-05 20:09:34 +11:00
kamilritz d5dc6bb8ea Clean get*innov* interface 2019-12-05 20:09:34 +11:00
kamilritz 86b9079bdc Refactoring velPos fusion 2019-12-05 20:09:34 +11:00
bresch 6b5f011bc2 ekf: use PDOP instead of GDOP as the TDOP (part of GDOP) is usually not available
PDOP is the position dillution of precision and is given by sqrt(VDOP^2+HDOP^2)
2019-11-25 17:18:40 -05:00
Daniel Agar 362a2dfa08
remove unnecessary <cmath> include 2019-11-22 11:16:51 -05:00
RomanBapst 33a2bd0292 added python script for derivation of initial wind covariance matrix
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-11-20 16:28:34 +11:00
bresch 811ec81246 parameters: change check_mag_strength from bool to int32_t to comply with the standard interface 2019-11-11 15:29:52 +01:00
Mathieu Bresciani c7bdf25663
[ekf] controlMagFusion refactor and mag field strength check (#662)
* ekf_control: Inhibit mag fusion when field magnitude is large
Move mag inhibition check in separate function

* ekf_control: pull out of functionalities out of controlMagFusion
- yaw abd mag bias observability checks
- mag 3D conditions
- load mag covariances
- set and clear mag control modes

* ekf_control: refactor mag heading/3D start/stop.
Move mag declination, mag 3d and mag heading fusion out of the main function

* ekf_control: extract mag yaw reset and mag declination fusion requirements

* ekf_control: use WMM in isStronMagneticField for mag fusion inhibition
- Correct units of WMM strength table

* ekf_control: extract mag_state_only functionality of AUTOFW (VTOL custom)
Also split inAirYawReset from onGroundYawReset

* ekf_control: extract mag automatic selection
- transform if-else into switch-case for parameter fusion type selection

* ekf_control: extract run3DMagAndDeclFusion, reorganize functions, fix
flag naming in Test script

* ekf_control: do not run mag fusion if tilt is not aligned.
Reset some variables on ground even if mag fusion is not running yet. It
could be that it runs later so we need to make sure that those variables
are properly set.

* ekf_control: move controlMagFusion and related functions to mag_control.cpp

* ekf control: check for validity of mag strength from WMM and falls back
to average earth mag field with larger gate if not valid

* ekf control: remove evyaw check for mag inhibition

* ekf control: change nested ternary operator into if-else if

* Ekf: create AlphaFilter template class for simple low-pass filtering
0.1/0.9 type low-pass filters are commonly used to smooth data, this
class is meant to abstract the computation of this filter

* ekf control: reset heading using mag_lpf data to avoid resetting on an outlier
fixes ecl issue #525

* ekf control: replace mag_states_only flag with mag_field_disturbed and
add parameter to enable or disable mag field strength check

* ekf control: remove AUTOFW mag fusion type as not needed This was implemented for VTOL but did not solve the problem and should not be used anymore

* ekf control: use start/stop mag functions everywhere instead of setting the flag

* ekf control: Run mag fusion depending on yaw_align instead of tilt_align
as there is no reason to fuse mag when the ekf isn't aligned

* AlphaFilter: add test for float and Vector3f
2019-11-08 16:02:59 +01:00
bresch a6840655e8 ekf: Extract resetState from main reset and reinitialize
the covariances in the init function
2019-11-05 09:07:25 +01:00
bresch bf48004fb9 ekf: move "reset" part of the init function into a separate function
add getter for the vehicle at rest flag
2019-11-05 09:07:25 +01:00
TSC21 7eb9118673 Jenkins: update container tags; use px4-dev-base-bionic 2019-11-03 10:29:15 -05:00
kamilritz d76b704225 Only inlcude gtest if standalone build 2019-11-02 09:46:18 -04:00
kamilritz 7c1e38d3ad Make it build with Firmware 2019-10-28 11:04:38 +01:00
kamilritz d79199c863 Remove swig and python test related things 2019-10-28 11:04:38 +01:00
kamilritz d88e242a60 pytest are replaced in gtests 2019-10-28 11:04:38 +01:00
kamilritz 71be26efc6 Port RingBuffer Test to GTests 2019-10-28 11:04:38 +01:00
kamilritz cac5f3fd6d GTest and Coverage cleanup and Basic EKF GTest 2019-10-28 11:04:38 +01:00
Martina Rivizzigno fcea13eef8 add gtest, temp disable swig
(cherry picked from commit 4008d163d77f503e6acbd7ddc1d87ac6d479c897)
2019-10-28 11:04:38 +01:00
RomanBapst 9b4b24ee71 removed unused definition
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-24 07:55:37 +11:00
RomanBapst 0e3a0b8659 range_finder_checks: parametrised signal quality hysteresis duration
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-24 07:55:37 +11:00
RomanBapst 16d1e15b51 addressed review comments
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-24 07:55:37 +11:00
RomanBapst 6bc6f26043 range_finder_checks: set range height to valid if signal quality is non-zero
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-24 07:55:37 +11:00
RomanBapst 6299d8199c ekf_helper: use latest validated range sample to reset height
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-24 07:55:37 +11:00
RomanBapst 00f49e62c2 cleanup checks of range finder data
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-24 07:55:37 +11:00
Paul Riseborough 4d37065f1b EKF: Make use of inverse rotation function consistent with name
The quaternion to inverse rotation matrix function has been updated so that the rotation it produces is the inverse to that produced by the matrix library and the the inverse of the quaternion is uses. This function is now used to directly calculate an inverse rotation matrix rather than calculating the forward rotation and then transposing it.
2019-10-23 14:44:08 +03:00
Paul Riseborough 36de2b3dc1 EKF: Use matrix library for quaternion to rotation matrix conversion 2019-10-23 14:44:08 +03:00
bresch 1a4ab069c9 rate controller: add override specifiers whenever needed 2019-10-22 09:12:19 -04:00
bresch 29f71fff96 ekf: Add override specifier for all functions that override virtual functions of the estimator interface class 2019-10-22 09:12:19 -04:00
bresch 50167bfbcf estimator interface: add deprecated functions for backward compatibility 2019-10-22 20:19:56 +11:00
bresch b38458c2ab Terrain estimator: formatting and remove redundant comments 2019-10-22 20:19:56 +11:00
bresch 0aef0eda59 terrain_estimator: remove dead code. Since the terrain estimator is
constantly reset on ground, it is not necessary anymore to fuse fake
measurements on ground if the range measurements are bad.
2019-10-22 20:19:56 +11:00
bresch 370e04ee60 terrain_est: Continuously reset terrain height on ground using known
clearance. This is the best estimate as we should not rely on a distance
sensor while on the ground. This also helps when the drone is carried
over as it avoids starting with a crazy downward distance for optical
flow scaling.
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
kamilritz f005e0ea8f Remove deprecated ev_innov_gate param 2019-09-27 10:00:45 -04:00
kritz b78429aa60 Fix print statements cast error on posix firmware builds (#647) 2019-09-25 14:34:43 +02: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
kritz bb88d4ce5e Undo wrong comment change 2019-09-24 08:50:29 +10:00