Commit Graph

689 Commits

Author SHA1 Message Date
bugobliterator cba5271785 add matrix submodule 2016-02-17 17:38:21 -08:00
bugobliterator 2f05f778de ignore build directory 2016-02-17 17:34:28 -08:00
bugobliterator 263c48d089 EKF: remove dependecies and allow ekf to be built as standalone shared lib 2016-02-17 17:33:18 -08:00
Paul Riseborough 96c0e18acb Merge pull request #49 from PX4/pr-fixMagCovariance
EKF: Fix magnetometer fusion and covariance handling
2016-02-18 10:22:36 +11:00
Roman Bapst 678d6f45cc Merge pull request #52 from bugobliterator/pr-airspeed-sample-fix
EKF: fix time of sample receive setting
2016-02-17 22:34:30 +01:00
bugobliterator 2096e24c06 EKF: fix time of sample receive setting 2016-02-17 13:29:12 -08:00
Paul Riseborough a679cdf1fb EKF: Change parameter default to not fuse declination when aiding
Ground and flight testing has shown declination drift to not be a problem with current tuning and realistic vehicle motion.
2016-02-17 17:22:02 +11:00
Paul Riseborough abf9476853 EKF: miscellaneous formatting and typo updates 2016-02-16 11:08:30 +11:00
Paul Riseborough ffe1d30864 EKF: Set covariances to zero for un-used states 2016-02-16 11:08:30 +11:00
Paul Riseborough 294aca8609 EKF: Improve variance limiting for stationary states
Turn off the process noise if they grow too large and use the hard variance limit as a backup. This is numerically more stable than relying on a hard variance limit which does not deal with the covariances.
2016-02-16 11:08:30 +11:00
Paul Riseborough 1d40507af8 EKF: Set Kaman gains to zero for un-used states
This is a defensive programming technique. In theory this should not be necessary if the corresponding covariance entries are zero.
2016-02-16 11:08:30 +11:00
Paul Riseborough 69b8982043 EKF: Initialise variances to zero for un-used states
Setting these variances to zero makes it less likely that these states will be modified by fusion processing.
2016-02-16 11:08:30 +11:00
Paul Riseborough d9bf4e9870 EKF: Enable control mode transitions to be detected
Save the previous value of the filter control modes
2016-02-16 11:08:30 +11:00
Paul Riseborough 402206a305 EKF: Fix critical bug in fusion of yaw and declination observations
This bug was in the derivation and resulted from use of a tan instead of an atan operator. The derivations have been reworked and the updated auto-code has been imported as part of this patch.
2016-02-16 11:08:30 +11:00
Paul Riseborough d8afca5e7a EKF derivations: Correct error in direct yaw and declination angle fusion
The atan function is now being used correctly instead of the tan function. This fixes problems with large heading errors or declination values.
The simple heading fusion has been decoupled from the magnetic field measurements. This enables external yaw measurements to be used in the future.
2016-02-16 11:08:30 +11:00
Paul Riseborough 7da40a45a4 EKF: Add control mode for wind state estimation 2016-02-16 11:08:30 +11:00
Paul Riseborough de02aebafd EKF: Reset covariance matrix when doing a yaw and magnetic field reset
The correlation terms in the covariance matrix will be incorrect after a reset, so should be zeroed
2016-02-14 22:01:53 +01:00
Paul Riseborough dba58aa4c6 EKF: Add control logic for fusion modes 2016-02-14 22:01:53 +01:00
Paul Riseborough 22c177c951 EKF: Re-align yaw and magnetic field states when changing into GPS aiding mode 2016-02-14 22:01:53 +01:00
Paul Riseborough c089079321 EKF: Split tilt and yaw align 2016-02-14 22:01:53 +01:00
Paul Riseborough 020cc5978e EKF: Move calculation of declination into a separate function 2016-02-14 22:01:53 +01:00
Paul Riseborough aa58b3e98c EKF: Split angular alignment into tilt and yaw and use yaw and magnetic field alignment function 2016-02-14 22:01:53 +01:00
Paul Riseborough 2bbe7f9a1c EKF: Update magnetometer fusion to use declination from the specified source 2016-02-14 22:01:53 +01:00
Paul Riseborough 83945581ed EKF: Add function to calculate the magnetic declination to use 2016-02-14 22:01:53 +01:00
Paul Riseborough 9017e077f8 EKF: Publish the magnetic declination we wish to save for next startup 2016-02-14 22:01:53 +01:00
Paul Riseborough 0308f2f796 EKF: Add parameters to control declination source and fusion type 2016-02-14 22:01:53 +01:00
Paul Riseborough 6140d4b21f EKF: Add function to reset yaw and magnetic field states 2016-02-14 22:01:53 +01:00
Roman ad978c642f estimator interface:
added flag for in_air status of vehicle
2016-02-14 20:43:22 +01:00
Roman ce0ddc0207 -added comments
-removed unused print functions
-removed false _imu_time_last variable (correct is _time_last_imu)
2016-02-14 09:49:26 +01:00
Paul Riseborough 9d7340e187 EKF: Fix bugs in position and velocity resets
The position reset was not being compensated for velocity and measurement delay
The height was being reset with the position. It has been moved into a separate reset function
The maximum accepted GPS delay of 100msec was inadequate
The states  was being incorrectly reset to the GPS position and Baro height on initial alignment.
2016-02-14 09:49:26 +01:00
Paul Riseborough da1de2cc4d EKF: Correct for sensor noise and baro offset during alignment 2016-02-14 09:49:26 +01:00
Roman Bapst d21ce70eeb Merge pull request #45 from CarlOlsson/move_fuse_function_to_helper
moved fuse function to ekf_helper.cpp
2016-02-13 08:21:28 +01:00
CarlOlsson 1e766c7510 moved fuse function to ekf_helper.cpp 2016-02-12 15:54:32 +01:00
Lorenz Meier 0a9f7e58db Merge pull request #43 from PX4/pr-baroHeightOffset
Correct for sensor noise and baro offset during alignment
2016-02-10 08:02:48 +01:00
Paul Riseborough fff2bd50f6 EKF: Fix bugs in position and velocity resets
The position reset was not being compensated for velocity and measurement delay
The height was being reset with the position. It has been moved into a separate reset function
The maximum accepted GPS delay of 100msec was inadequate
The states  was being incorrectly reset to the GPS position and Baro height on initial alignment.
2016-02-10 15:16:05 +11:00
Paul Riseborough 40e174b81c EKF: Correct for sensor noise and baro offset during alignment 2016-02-10 10:25:27 +11:00
Paul Riseborough a6515543da Merge pull request #41 from PX4/pr-magFusionUpdates
EKF2: Prevent declination/heading drift during non-GPS operation
2016-02-09 07:57:34 +11:00
Paul Riseborough 5ea0ef39cd EKF: Update declination fusion logic
We do not need to run declination fusion if 3-axis mag fusion is not being used.
2016-02-09 07:54:24 +11:00
Paul Riseborough 47ab5ebcdd EKF: Make PR comply with project convention for indenting 2016-02-08 15:12:38 +11:00
Paul Riseborough cdc42c1de0 EKF: Add simple control logic for magnetic declination constraint 2016-02-08 14:18:43 +11:00
Paul Riseborough dbb8e12948 EKF: Add fusion method to constrain declination when unobservable
When fusing 3-axis magnetometer data without absolute external aiding leg GPS), the declination is ultimately unobservable and the declination of the  field states and the vehicle heading will slowly drift over time. To prevent this we need to fuse in a declination to constraint the NE earth field estimates.
2016-02-08 14:18:43 +11:00
Paul Riseborough 9347afe250 EKF: Use unique variable name for mag heading fusion observation Jacobian 2016-02-08 14:18:43 +11:00
Paul Riseborough 6aeccf01ff EKF: Add missing fusion health status messages 2016-02-08 14:18:43 +11:00
Paul Riseborough a22886544d EKF: Add missing Kalman gain to Declination fusion autocode 2016-02-08 14:02:08 +11:00
Paul Riseborough 2c8c6efb45 EKF: Eliminate use of power function to square numbers
Use of the power function to square a number can be very inefficient depending on processor and compiler. Replace with an inlined function  that multiplies the number by itself. This has not been put into the maths library because the use of the sq() function is peculiar to the autocode generated for the EKF and an inlined function was desired.
2016-02-08 11:11:59 +11:00
Paul Riseborough 42a943b37e EKF: Fix text errors introduced when editing optical flow fusion autocode fragment 2016-02-07 21:49:50 +11:00
Paul Riseborough f99256286b Merge pull request #40 from PX4/pr-updateOpticalFlowAutoCode
Update EKF Optical Flow Fusion Autocode Fragments
2016-02-07 19:35:38 +11:00
Paul Riseborough 384ce06110 EKF: Add alternative code fragments for optical flow fusion
These fragments were generated using the inbuilt matlab symbolic toolbox autocoder and may be more efficient than the other method
2016-02-07 19:31:13 +11:00
Paul Riseborough dba462b9f3 EKF: Improve efficiency of optical flow fusion auto generated code fragments 2016-02-07 19:29:49 +11:00
Paul Riseborough 3f81eb7d1b EKF: fix formatting 2016-02-04 17:15:03 +11:00