Skip to content

Tpsi 3160 sryu#11

Closed
shokoryu wants to merge 307 commits into
developfrom
TPSI-3160-sryu
Closed

Tpsi 3160 sryu#11
shokoryu wants to merge 307 commits into
developfrom
TPSI-3160-sryu

Conversation

@shokoryu
Copy link
Copy Markdown

@shokoryu shokoryu commented Mar 16, 2023

Jira
What this PR includes

rlabbe and others added 30 commits January 9, 2018 16:48
Added functions to create a kinematic Kalman filter and a kinematic
state transition matrix.
The code for sizing and assignement of H was incorrect for the
kinematic filter
in two places. Now we compute it once and store it to gain a
bit of speed.
things like k.R = 1, and the result would be k.R == np.array([[1],[1]])
and such. It makes for tricky code, and is slower as well.
the entire book, but there admiteddly isn't much there. I've added
a link to my book in most of the classes to help point people
in the right direction.
The functions update and predict allow you to use floats instead
of matrices to implement the univariate case. However, there were
forms of dot(a,b).dot(c) in the code, which raise exceptions if
all the variables are floats. Changed to the nested form
dot(dot(a,b),c)
changed relevant int constants to floats. Along the way
added spaces after commas where needed, and converted the
remaining .dot calls to the nested dot(dot form.
I was importing Kalmanfilter, but it needed to be relative.
I was setting them to zero; if you call predit() or update()
you get an exception because the rest of the variables are
properly initialized.
It was creating H with the wrong dimension and value.
Updated the tests to test for this.
I was not creating all of the matrices with the correct size.
That fix is already checked in, but this tests for it.
I was computing F incorrectly if order_by_dim=False
I reshape z based on the KF's dimensions, but I had a few bugs since
I assumed that x must be shaped (N,1), but a lot of my code uses the
1D form.

I think I should remove the 1D form as it is pretty confusing and
incompatible with, for exmaple, the UKF module.
For some reason I was trying to do an absolute import
for kalman.
It's time to switch to Python 3.5. Deal with it!
Added function to compute log-likelihood without using the KalmanFilter
class.
Measurement matrix dimensions in Kalman filter class doc block is misleading and should be changed.
Fix a bug where 2nd order GH ignores k
Fix doc block for Kalman filter measurement matrix
Calling log_likelihood(z) really messes up the IMM code, since
it shouldn't really need to remember z. Also, it forces the
innovation to be recomputed. Therefore, I added an attribute
as to whether we should automatically compute the log-likelihood
during updates.
There were several minor issues that I cleaned up.
rlabbe and others added 27 commits June 29, 2022 13:13
kinematic_kf creates an object of type KalmanFilter. However,
you may want to use a different class, so now you can optionally
pass in a pre-created filter.
If you pass a list or tuple to pretty_str it will now print out
and indexed list of the content of the list, one per line
Copied code for computing the logpdf from scikit-learn to make the
tests more robust by comparing with a different compuational technique
was using np.size to get length of the z list, but now that we
allow None in the list that caused a warning that the array was
ragged. Switched to using len()
It creates deprecation warning if you dont' pass in 1D arrays.
Filterpy's mahalanobis function is more forgiving, so switched
to using it instead.
Added two functions; one to compare the states of two vectors, and
one to copy the states of one to another. Mostly useful for writing
unit tests.
Added method to automatically generate a __repr__ string from
a filtering class. Ran black to auto format everything.
If a variable has the format y=[[2.]] for each update, then the saver contains
[[[2.]], [[3.]], ...] and after flattening it was a 2D colmn array. This
is a bug, and I changed it to flatten that 2D column array to a 1D
array.
@shokoryu shokoryu closed this Mar 16, 2023
@shokoryu shokoryu deleted the TPSI-3160-sryu branch March 16, 2023 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.