Commit Graph

136 Commits

Author SHA1 Message Date
Julian Kent 8d60f8ba8f Remove direct unsafe access to matrix internal data 2019-09-18 08:42:58 +02:00
Nico van Duijn 640e41cba7 EKF: change rangeSample quality to int8_t 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
kamilritz a2ff415fe4 Fix get frame aligning quaternion function 2019-08-29 08:34:10 +10:00
bresch e1751188fd EKF - Initialize _deadrekon_time_exceeded to true.
If no sample have been received, deadrekoning and local position should be invalid.
2019-06-28 10:52:52 -04:00
Robert de Vries 340d85afc1 EKF: fix variable names in estimator_interface.h
This fixes issue #566
2019-05-27 17:39:42 -04: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 8d6e8ae078 EKF: update get_mag_decl_deg()
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2019-03-13 08:14:23 +11:00
Nuno Marques 4e0e68e905 Ekf: add more useful methods to interface with the covariances (#543) 2019-03-09 11:57:35 -05:00
Daniel Agar c66f7f4a09 EKF drop unused timestamp from collect_gps() and pass data by const reference 2019-03-05 17:26:19 -05:00
Freek van Tienen 78b899c72d Add Paparazzi compatibility (#580)
This adds support for the paparazzi autopilot to use this library as EKF.
The header order change has to be done in order to have std.h included to get certain defines at the start of the estimator_interface.h.
2019-03-05 12:41:21 -05:00
Paul Riseborough 3accab1ac5 EKF: protect declination fusion from badly conditioned earth field estimates
Fusion with large initial magnetometer biases errors can result in the the NE earth field states reducing in magnitude and effectively flipping sign.

EKF: Move declination state limiting into a separate function

EKF: Limit NE mag states after each 3-axis mag fusion

EKF: Fix bug in mag field strength look-up scale factor
2019-01-31 09:53:57 -05:00
Daniel Agar 572710ed27 EKF add typed Quatf getter 2018-11-14 22:50:39 +01:00
Daniel Agar 8bbaf898a5
EKF add new simple setIMUData() interface (#512) 2018-10-17 15:30:25 -04:00
Paul Riseborough 91f886cb5e EKF: Add support for use of GPS heading data.
Heading data is assumed to be from a  dual antenna array at a specified yaw angle offset in body frame, but with the heading data already corrected for antenna offset. The offset is required to apply the correct compensation for combined rotations and to determine when the yaw observation has become badly conditioned.
2018-09-19 06:32:43 +10:00
Daniel Agar 0d39072a6d EKF add missing header guards 2018-08-30 12:07:25 -04:00
Paul Riseborough 35f628e68f
EKF: Add interface to enable logging of GPS drift metrics (#490)
* EKF: Add interface to enable logging of GPS drift metrics

* EKF: Fix bug affecting rate of GPS drift publication

Also fix variable name.
2018-08-03 13:24:31 +10:00
Paul Riseborough e0bcfeb533 EKF: Add validity boolean to mag declination accessor 2018-07-26 07:51:58 +02:00
Paul Riseborough 1e610894b9 EKF: Correct documentation and function name for declination accessor
The function name and documentation are misleading given the function is only a getter.
This change makes the usage clearer.
2018-07-26 07:51:58 +02:00
Paul Riseborough 4d59c834eb EKF: Consolidate range finder checking
This brings all the range finder data checks (excluding innovation consistency checks) into one place and eliminates the need to perform range checking external to the library.
The hard coded optical flow tilt limit is changed to use the same value as the range finder.
Variable names are changed to make a clear distinction between the max/min values calculated by the stuck range check and the max/min valid values for the sensor.
2018-07-12 18:20:50 +02:00
Daniel Agar 41953ab582 EKF angle constants in degrees for readability (#465)
* EKF angle constants in degrees for readability

* EKF make FILTER_UPDATE_PERIOD_MS static constexpr and add FILTER_UPDATE_PERIOD_S

* EKF controlOpticalFlowFusion() use constants and update comments

* EKF controlMagFusion() use angle in degrees

* EKF move earth spin rate to geo and update usage

* EKF: Fix numerical constant error and clean up comments

Comments do not need to contain numerical values when the code makes these clear.
2018-07-05 08:55:22 +10:00
Daniel Agar cebdc3d829 ekf run output predictor immediately with new IMU data (#471)
* EKF collect_imu take const imu sample and populate buffer

* EKF calculateOutputStates cleanup

* EKF add calculate_quaternion output predictor method

* EKF: update documentation

* EKF: remove unnecessary getter function

* EKF calculateOutputStates only apply dt correction to bias

* EKF pytest assert attitude validity, not update() return

* EKF: correct documentation

* EKF: Do not make attitude validity dependent on yaw alignment status

Yaw alignment could fail in flight due to temporary loss of data and yet the quaternions would still usable for stabilisation even though the absolute earth yaw angle wrt true north was uncertain.
2018-07-05 07:59:35 +10:00
Paul Riseborough 48561b0c8a EKF: Update optical flow interface documentation 2018-06-12 16:52:26 +10:00
Mohammed Kabir b4d2b8c57d EKF : introduce new architechture for navigation limits 2018-06-09 22:23:55 +02:00
Paul Riseborough e10798bfdf EKF: Add on ground movement detector 2018-06-09 22:23:55 +02:00
Daniel Agar c5b2f59f57 PX4 style fixes (excluding EKF generated code) 2018-05-03 22:25:36 -04:00
Daniel Agar e5952fadaf cmake standalone build 2018-05-03 22:25:36 -04:00
Daniel Agar a14434d6dc EKF always fill position and velocity accuracy (#425) 2018-04-23 21:15:29 +10:00
Paul Riseborough ae069b12d6
EKF: Fix bug preventing wind relative dead reckoning 2018-04-21 13:04:04 -04:00
Paul Riseborough 9747dc778d
EKF: Rework nav validity reporting
Remove duplicate checking for dead reckoning and consolidate into a single function.
Use separate timers to check for start of dead reckoning and check when dead reckoning has been performed for too long for the nav solution to be valid.
Allow the timeout for validity reporting to be adjusted externally.
Separate external reporting of dead reckoning from internal checks.
2018-04-21 13:04:04 -04:00
Daniel Agar cd12f049fe move geo and geo_lookup from PX4 Firmware to ECL 2018-03-26 21:52:11 -04:00
Daniel Agar 341f8962d2
EKF interface add get_wind_status() (#406) 2018-03-14 16:41:09 -04:00
CarlOlsson 5c8b22b43f ekf: return beta test ratio in get_innovation_test_status
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2017-12-18 15:48:36 +01:00
Paul Riseborough b0ad8269a5 EKF: enable separate monitoring of aux velocity innovations 2017-11-21 11:18:09 +11:00
Paul Riseborough 8e30c2666d EKF: Add support auxiliary velocity observation
This enables the EKF to use an additional NE velocity measurement. This can be used to improve position hold stability when landing using a beacon system for positioning by fusing the beacon velocity estimates.
2017-11-21 11:18:09 +11:00
Paul Riseborough a2b24fa960 EKF: Protect against ground effect induced static pressure rise during landing and takeoff.
Apply a dead-zone to the vertical position innovation if using baro for height and if in the ground effect region during and just after takeoff.
Method needs to be activated externally.
Turns off automatically after 10 seconds or if specified height gained.
2017-11-17 21:41:31 +11:00
Daniel Agar d9c8af54bd
EKF add print_status() with memory usage 2017-11-16 14:11:34 -05:00
Daniel Agar 75d1ed894c
EKF simplify RingBuffer allocation check 2017-11-16 13:09:17 -05:00
Paul Riseborough d785a19c0a EKF: delay final allocation of observation buffers until required 2017-11-16 19:47:04 +11:00
Paul Riseborough 7852c0ed03
Merge pull request #312 from PX4/pr-ekfExtVisQuat
EKF: Enable operation with arbitrary External Vision reference frame
2017-11-12 08:35:39 +11:00
Paul Riseborough bba3f70a0e EKF: reduce prediction time step from 12 to 8 sec
Reduces susceptibility to incorrect estimation of acceleration bias during sustained yaw rate.
Requires an increase in RAM allocation of 837 Bytes to allow for the longer IMU and output predictor buffers that can be created.
2017-11-02 09:27:33 +01:00
Paul Riseborough 01d68ef67c EKF: Enable use of rotated external nav estimates 2017-11-01 08:33:57 +11:00
Paul Riseborough 063533afae EKF: Add method to enable the IMU bias states to be reset externally 2017-10-26 10:41:39 +11:00
Paul Riseborough cd2ca57ec2 Merge pull request #339 from PX4/ekfPosCtrlLimits-wip
Ekf pos ctrl limits wip
2017-10-23 06:57:23 +11:00
Paul Riseborough 79995b2c15 Create total energy control system implementation
This is a new, clean and streamlined variant of the mathematical derivation I created a few years ago.
2017-10-22 20:37:40 +02:00
Paul Riseborough 929c5c2b37 EKF: enable gps fusion flag to be false while fusing air data 2017-10-20 14:44:37 +11:00
Paul Riseborough 9857fb9eb6 EKF: publish control limits for optical flow navigation 2017-10-20 14:22:06 +11:00
Paul Riseborough 68bad48598 Merge pull request #330 from CarlOlsson/pr-add_get_wind_vel_var
EKF: added get_wind_velocity_var function
2017-10-12 09:12:54 +11:00
ChristophTobler 6cb99ce8a8 ekf: add function to get in air status 2017-10-03 22:36:33 +02:00
CarlOlsson 8200e4b218 EKF: added get_wind_velocity_var function
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2017-10-02 14:47:56 +02:00