-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vehicle Researcher
committed
Dec 6, 2017
1 parent
5627d0d
commit 1ad9cc8
Showing
30 changed files
with
472 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import numpy as np | ||
|
||
|
||
class KF1D: | ||
# this EKF assumes constant covariance matrix, so calculations are much simpler | ||
# the Kalman gain also needs to be precomputed using the control module | ||
|
||
def __init__(self, x0, A, C, K): | ||
self.x = x0 | ||
self.A = A | ||
self.C = C | ||
self.K = K | ||
|
||
self.A_K = self.A - np.dot(self.K, self.C) | ||
|
||
# K matrix needs to be pre-computed as follow: | ||
# import control | ||
# (x, l, K) = control.dare(np.transpose(self.A), np.transpose(self.C), Q, R) | ||
# self.K = np.transpose(K) | ||
|
||
def update(self, meas): | ||
self.x = np.dot(self.A_K, self.x) + np.dot(self.K, meas) | ||
return self.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.