Closed ghost closed 1 year ago
Using a float data type reduces the numerical precision that the filter can handle. I recommend reading some literature / searching for methods which have run Kalman filters on embedded devices or space applications.
Likely negatives mean that there was a poor conditioned update, or the measurement model is incorrect. It is hard to address this problem. One simple method is to "undo" the update, and just drop the measurements if they cause a invalid covariance, but this is clearly not ideal.
Remember that the covariance should be a semi positive definite matrix to be a gaussian. https://en.wikipedia.org/wiki/Definite_matrix
Thank you for your timely response. We also noticed the following phenomena while trying:
Thank you for your time.
Do you have a dataset where this problem occurs? Likely this means your sensors are not properly calibrated, the noises are not correct, or the chi2 allowed an outlier / bad measurement to be in the update.
You might also try to play around with the initial prior. Sometimes a bad initial prior can easily lead to negative diagonals.
Thank you for your prompt reply. 1、Such a problem occurred in our own collection of data sets 2、We will take a closer look at the sensor calibration procedure. 3、Try adjusting the chi2 threshold. Thanks again.
You might also try to play around with the initial prior. Sometimes a bad initial prior can easily lead to negative diagonals.
Thank you for your reminder. We will go and confirm whether there is a problem with the initial prior.
Hello, I made a small change to the code:
1: In StateHelper::EKFUpdate() function the matrix operation related to the covariance matrix, use the float data type instead of the double type.
Exception result:
Questions: 1: Why the diagonal elements of covariance matrix have negative values? 2: Is there any way to avoid the situation where the diagonal elements in the covariance matrix is negative? 3: If the diagonal elements in the conference matrix have negative values, is there any better way to deal with it? The current solution is to exist the program directly.
Thanks a lot for your time.