]> defiant.homedns.org Git - pyshared.git/commitdiff
simple_kalman: Added set_measure_cov()
authorErik Andresen <erik@vontaene.de>
Mon, 30 Jul 2018 06:58:30 +0000 (08:58 +0200)
committerErik Andresen <erik@vontaene.de>
Mon, 30 Jul 2018 06:58:30 +0000 (08:58 +0200)
simple_kalman.py

index 578397c8a8939e43fd5b7abf9a1269b77acf1bac..5e61328f0da086a034a75c5699a2c2cf6cfc6aea 100755 (executable)
@@ -38,6 +38,11 @@ class simple_kalman:
                if x.shape == (1,1): return x.item(0,0)
                return x
 
+       def set_measure_cov(self, R):
+               if type(R) != type(np.matrix([0])): R = np.matrix(R)
+               if np.all(R >= np.zeros([2,2])):
+                       self.R = R
+
 
 if __name__ == '__main__':
        import random