From: Erik Andresen Date: Mon, 30 Jul 2018 06:58:30 +0000 (+0200) Subject: simple_kalman: Added set_measure_cov() X-Git-Url: https://defiant.homedns.org/gitweb/?a=commitdiff_plain;h=2056613e07dc73a25e8426a6ca67fccc88e13fee;p=pyshared.git simple_kalman: Added set_measure_cov() --- diff --git a/simple_kalman.py b/simple_kalman.py index 578397c..5e61328 100755 --- a/simple_kalman.py +++ b/simple_kalman.py @@ -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