Skip to content

Commit

Permalink
Verified Process Covariance Matrix Prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin-Furtado committed Feb 26, 2024
1 parent 9c8b571 commit b71935b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
Binary file modified Phase 2/filter_py_lib_test/__pycache__/constants.cpython-311.pyc
Binary file not shown.
Binary file modified Phase 2/filter_py_lib_test/__pycache__/graph.cpython-311.pyc
Binary file not shown.
Binary file not shown.
6 changes: 4 additions & 2 deletions Phase 2/filter_py_lib_test/high_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'''
Things to go
1. verify the Process covarinace matrix, the last two rows do not seem to change
I checked this on matrix calculator the numbers are right
2. build kalman filter class
3. Measurement matrix Y
'''
Expand Down Expand Up @@ -91,7 +92,7 @@ def main():

## Initalisation ##
covar = kal.kalman_initial(position,velocity, acceleration)
P_initial = covar.P_initial(2,1,5,3)
P_initial = covar.P_initial(2,1,8,7)

# P_predict = kal.Prediction(None,None,None)
# print(P_predict.P_predicted(P_initial))
Expand Down Expand Up @@ -122,7 +123,8 @@ def main():

# Updation
P_prev = predict_P
print(predict_P, P_prev)
# print(predict_P, P_prev)
# print(predict_P)
'''
The last two rows are not changing
'''
Expand Down
3 changes: 2 additions & 1 deletion Phase 2/filter_py_lib_test/kf_computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ def P_predicted(self):
A.P_prev.A^T + Q
'''
prev = self.P_previous
P = A_matrix(prev)@prev@A_matrix(prev).transpose() #+Q
print(prev)
P = A_matrix(prev)@prev@(A_matrix(prev).transpose()) #+Q

## Simplyfing the calcuations
P[0][1] = 0
Expand Down

0 comments on commit b71935b

Please sign in to comment.