update pipfile.lock (#1896)

* update pipfile

* matrix is deprecated

* Numpy almost equal

* sympy 1.6
old-commit-hash: 95b0c69c12
commatwo_master
Willem Melching 5 years ago committed by GitHub
parent f646a64cce
commit 760044710c
  1. 4
      Pipfile
  2. 4
      Pipfile.lock
  3. 2
      common/kalman/simple_kalman_old.py
  4. 20
      common/kalman/tests/test_simple_kalman.py

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:03a69ace0d3ec21dacbfbbcad17688191d4f022a519e5447cda33922fb677e24 oid sha256:cfdd366178aaffdf25d292e6b949e6eb80be25a9d10d1315059af9704e795e63
size 1980 size 1986

4
Pipfile.lock generated

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:88300c38c21842e55204a6e351985dfcb0c24b1e882432698472dbdc378cd9f8 oid sha256:a374661ecc896e1c10c2874bff0235ce2d6f3dc0b3fbcb40f987153ed13f09a1
size 171081 size 175263

@ -8,7 +8,7 @@ class KF1D:
def __init__(self, x0, A, C, K): def __init__(self, x0, A, C, K):
self.x = x0 self.x = x0
self.A = A self.A = A
self.C = C self.C = np.atleast_2d(C)
self.K = K self.K = K
self.A_K = self.A - np.dot(self.K, self.C) self.A_K = self.A - np.dot(self.K, self.C)

@ -21,10 +21,10 @@ class TestSimpleKalman(unittest.TestCase):
K0_0 = 0.12287673 K0_0 = 0.12287673
K1_0 = 0.29666309 K1_0 = 0.29666309
self.kf_old = KF1D_old(x0=np.matrix([[x0_0], [x1_0]]), self.kf_old = KF1D_old(x0=np.array([[x0_0], [x1_0]]),
A=np.matrix([[A0_0, A0_1], [A1_0, A1_1]]), A=np.array([[A0_0, A0_1], [A1_0, A1_1]]),
C=np.matrix([C0_0, C0_1]), C=np.array([C0_0, C0_1]),
K=np.matrix([[K0_0], [K1_0]])) K=np.array([[K0_0], [K1_0]]))
self.kf = KF1D(x0=[[x0_0], [x1_0]], self.kf = KF1D(x0=[[x0_0], [x1_0]],
A=[[A0_0, A0_1], [A1_0, A1_1]], A=[[A0_0, A0_1], [A1_0, A1_1]],
@ -47,8 +47,8 @@ class TestSimpleKalman(unittest.TestCase):
x = self.kf.update(v_wheel) x = self.kf.update(v_wheel)
# Compare the output x, verify that the error is less than 1e-4 # Compare the output x, verify that the error is less than 1e-4
self.assertAlmostEqual(x_old[0], x[0]) np.testing.assert_almost_equal(x_old[0], x[0])
self.assertAlmostEqual(x_old[1], x[1]) np.testing.assert_almost_equal(x_old[1], x[1])
def test_new_is_faster(self): def test_new_is_faster(self):
setup = """ setup = """
@ -69,10 +69,10 @@ C0_1 = 0.0
K0_0 = 0.12287673 K0_0 = 0.12287673
K1_0 = 0.29666309 K1_0 = 0.29666309
kf_old = KF1D_old(x0=np.matrix([[x0_0], [x1_0]]), kf_old = KF1D_old(x0=np.array([[x0_0], [x1_0]]),
A=np.matrix([[A0_0, A0_1], [A1_0, A1_1]]), A=np.array([[A0_0, A0_1], [A1_0, A1_1]]),
C=np.matrix([C0_0, C0_1]), C=np.array([C0_0, C0_1]),
K=np.matrix([[K0_0], [K1_0]])) K=np.array([[K0_0], [K1_0]]))
kf = KF1D(x0=[[x0_0], [x1_0]], kf = KF1D(x0=[[x0_0], [x1_0]],
A=[[A0_0, A0_1], [A1_0, A1_1]], A=[[A0_0, A0_1], [A1_0, A1_1]],

Loading…
Cancel
Save