From 2056613e07dc73a25e8426a6ca67fccc88e13fee Mon Sep 17 00:00:00 2001 From: Erik Andresen Date: Mon, 30 Jul 2018 08:58:30 +0200 Subject: [PATCH] simple_kalman: Added set_measure_cov() --- simple_kalman.py | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.39.5