Commit Graph

98 Commits

Author SHA1 Message Date
CarlOlsson 5205a8198b added function to control when to fuse beta 2016-11-05 12:19:01 +01:00
CarlOlsson 8f6c75bb0b adopted ekf.h 2016-11-05 12:19:01 +01:00
Paul Riseborough 1b59a89a18 EKF: save some stack memory 2016-11-02 09:06:06 +01:00
Beat Küng 25cb400da9 EKF: remove Ekf::KHP and move KHP to the methods where it's used
Everywhere where KHP is used, it is first completely reset, thus making
it unnecessary to keep it as a class member.

This saves 2.3KB RAM.

Stack sizes don't need changing, since there is already a function
Ekf::predictCovariance(), which needs around 3KB of stack and is called
close to where the fuse* functions are called.
2016-11-01 22:49:20 +01:00
Paul Riseborough b10b0184c5 EKF: Add IMU vibration calculation and reporting
Add calculation and reporting of IMU delta angle and velocity coning and high frequency vibration
2016-10-19 21:46:55 +11:00
Paul Riseborough 352750e5d1 EKF: publish ekf solution status summary data 2016-10-06 09:02:29 +02:00
Paul Riseborough 744b79c1b2 EKF: Publish innovation test ratios 2016-10-06 09:02:29 +02:00
Paul Riseborough 65762e5998 EKF: publish output predictor tracking errors 2016-10-03 14:13:07 +11:00
Paul Riseborough c81f9f1dba EKF: Reduce output predictor tracking errors
Implements a PI tracking loop
2016-10-03 14:13:07 +11:00
Paul Riseborough 75bec44b94 EKF: add function to initialise wind states 2016-08-11 15:26:21 +02:00
Paul Riseborough 6dff2df28e EKF: Add method to reset wind state covariances
Set variances in polar coordinates and rotate into cartesian frame
2016-08-11 15:26:21 +02:00
Youssef Demitri 168d9add76 added getter function for wind states 2016-07-22 12:33:41 +02:00
Paul Riseborough 5f9752cac8 EKF: Improve function names 2016-06-30 17:06:32 +10:00
Paul Riseborough 7bc9217f00 EKF: Clean up control of observation fusion
All the decision for a sensor are made within a specific function for that sensor and when there is data to process at the fusion time horizon.
Information and warning messages are improved.
2016-06-30 17:06:32 +10:00
Roman Bapst bec1a6831e added method to get gyro bias
Signed-off-by: Roman Bapst <roman@px4.io>
2016-06-21 14:13:47 +02:00
Paul Riseborough 928a7dd059 Merge pull request #157 from PX4/pr-ekf2ResetInterface
Change state reset information interface
2016-06-08 14:18:31 +10:00
Paul Riseborough 99b34f0df4 EKF: Only reset necessary terms when mag fusion covariance reset required
Only the quaternion and mag fusion state covariances are used in the mag fusion calculations.
2016-06-08 11:58:33 +10:00
Paul Riseborough 081e17729c EKF: delay commencement of 3D mag fusion until clear of ground
Wait until enough height has been gained to be clear of ground based magnetic anomalies. Failure to do so can result in incorrect earth field initialisation.
2016-06-06 21:59:46 +10:00
Roman Bapst 670c6ca019 change state reset information interface for more convenient handling
on firmware side
2016-06-06 13:22:20 +02:00
Paul Riseborough 6a55d908c5 EKF: replace reset event times with event counters
Using a 64bit integer was unnecessary given it was only being used to detect a new reset event.
2016-06-01 17:13:00 +10:00
Paul Riseborough e371a303a9 EKF: publish the quaternion reset event 2016-06-01 17:13:00 +10:00
Paul Riseborough 2b0d5c28f0 EKF: capture full quaternion change for reset events 2016-06-01 17:13:00 +10:00
Paul Riseborough b2e432e211 EKF: publish position and velocity reset data 2016-06-01 17:13:00 +10:00
Paul Riseborough 733862f649 EKF: move the reset status struct to the Ekf class
This protects it from being modified externally
2016-06-01 17:13:00 +10:00
Paul Riseborough aca0336392 EKF: update vertical position and velocity reset capture
Use reset event struct members instead of separate variables
2016-06-01 17:13:00 +10:00
Carl Olsson 0fafc49a49 fixed typos (#147) 2016-05-22 17:40:43 +02:00
waltjohnson 7c158aa59b Addressed C99 compiler issues of initializing variables in header and unused included statements. 2016-05-19 09:58:18 -06:00
Paul Riseborough 22fba0fc6e EKF: don't initialise filter without EV data if we are relying on it 2016-05-18 19:25:19 +10:00
Paul Riseborough 57b2a256f7 EKF: Improve initialisation of quaternion covariances
Convert uncertainty in initial rotate vector into quaternion covariances using symbolic toolbox derived expressions.
Enable setting of initial angle uncertainty via a parameter
2016-05-17 12:47:20 +10:00
Paul Riseborough 1540e937b1 EKF: Improve tilt alignment monitoring
Convert quaternion covariances into an angular alignment variance vector and discard the z component so that yaw uncertainty does not affect the result.
2016-05-17 11:17:24 +10:00
Paul Riseborough b985e58333 EKF: clean up control function
With the addition of new observation types, the control function has become too large and needed be broken up into separate functions
2016-05-14 21:17:29 +10:00
Paul Riseborough c7e225124c EKF: Improve output observer position and velocity tracking
Replace the delayed time feedback mechanism used by the translational states with a direct feedback method.
Time constants for velocity and position convergence can be separately adjusted with tunable parameters
The method is more computationally more expensive because it requires modification of the output buffer history but is acceptable because it only requires 6 FLOP per buffer index for a total of 30*6 = 180 FLOP
The method was not applied to the attitude states because the quaternion operations required at each buffer index would have been computationally prohibitive.
2016-05-14 12:45:29 +09:30
Paul Riseborough 481c624975 EKF: Remove use of vehicle arm status
Use single externally set in-air status for all decisions
2016-05-10 10:23:08 +10:00
Paul Riseborough 724280fd1f EKF: move calculation of optical flow observation variance into a function
Allows it to be used when calculating initial state variance
2016-05-08 15:40:06 +10:00
Paul Riseborough 25682dce91 EKF: Prevent badly conditioned covariance calculation when starting or resetting to optical flow 2016-05-08 10:30:40 +10:00
Paul Riseborough 7f5669fb2d EKF: consolidate covariance corrections
Combines the forced symmetry, variance limiting and zeroing of covariances for unwanted states in the one function.
This ensures a consistent correction is applied after every covariance prediction or correction.
2016-05-07 20:29:50 +10:00
Paul Riseborough f1b7e7714e EKF: Make average update rate of EKF closer to target
With the EKF, the average update rate is more important than the instantaneous value as it affects tuning. This patch ensures that the EKF prediction cycle will be performed early if the previous one was late in an attempt to maintain the target update rate.
2016-05-05 21:23:03 +10:00
Paul Riseborough 727a43764f EKF: update initial angle alignment check 2016-05-05 21:23:03 +10:00
Paul Riseborough fe9f88a8b4 EKF: test new derivation
Use direct attitude parameterisation
Discard scale factors
Add accel bias
2016-05-05 21:23:03 +10:00
Paul Riseborough 4fcbfb5d42 EKF: correct error in comment 2016-04-23 07:55:25 +10:00
Paul Riseborough 874558d194 EKF: improve detection of bad vert accel data
Improve ability to detect if bad vertical accel data has caused loss of height accuracy by using historical data.
2016-04-22 09:24:04 +10:00
Paul Riseborough 421703c267 EKF: rework initialisation of height state and offsets 2016-04-22 08:38:41 +10:00
Paul Riseborough 10bf05e9a6 EKF: publish the vertical position offset 2016-04-22 08:30:46 +10:00
Paul Riseborough 0de15b1b20 EKF: Add variables to monitor vertical position and height offset 2016-04-22 08:28:56 +10:00
Lorenz Meier 9487eac505 Merge pull request #98 from priseborough/pr-ekf2StatusReporting
EKF: improve reporting of filter status
2016-04-20 11:44:02 +02:00
Roman Bapst 99fc61c27c ekf2 airspeed fusion:
- finished logic for fusion
- fixed bug where previous control status was set in the wrong location
2016-04-19 09:53:31 +02:00
Paul Riseborough 31bf342fc1 EKF: publish GPS check status 2016-04-19 17:38:22 +10:00
Roman Bapst 60abf07bee added function to return accelerometer bias 2016-04-18 17:52:16 +02:00
Paul Riseborough 2dcc6e2053 EKF: Improve accuracy of state prediction
Use an a common estimator value for gravity
Use average orientation across update interval when rotating delta velocities
2016-04-12 11:14:31 +10:00
Paul Riseborough 5bf02517a7 EKF: Rationalise use of rotation matrices and improve efficiency 2016-04-12 11:14:31 +10:00