From: Erik Andresen Date: Mon, 30 Jul 2018 11:14:19 +0000 (+0200) Subject: dwm1000: Reset estimate when we loose the dwm so the sensor values is X-Git-Url: https://defiant.homedns.org/gitweb/?p=ros_wild_thumper.git;a=commitdiff_plain;h=4567660199e3bbee6be162cc169df125b60e4fd8;ds=sidebyside dwm1000: Reset estimate when we loose the dwm so the sensor values is trusted more then the estimate --- diff --git a/scripts/dwm1000.py b/scripts/dwm1000.py index 535d81e..b237516 100755 --- a/scripts/dwm1000.py +++ b/scripts/dwm1000.py @@ -64,9 +64,9 @@ class DW1000(threading.Thread): class Position: def __init__(self): - R = np.matrix([[0.045, 0.5], [0.0, 0.008]]) # Varianz des Messfehlers - P_est = 1e-3 * np.eye(2) # Fehlerkovarianz - Q = np.matrix([[0.001, 0.0], [0.0, 0.00001]]) # Systemrauschen + R = np.matrix([[0.5, 0.0], [0.0, 0.2]]) # Varianz des Messfehlers + P_est = 1e50 * np.eye(2) # Fehlerkovarianz + Q = np.matrix([[0.001, 0.0], [0.0, 0.0001]]) # Systemrauschen self.filter_xy = simple_kalman(np.array([[1.0, 0.0]]).T, P_est, Q, R) self.speed_x = 0 self.speed_y = 0 @@ -106,6 +106,7 @@ class Position: self.filter_xy.set_measure_cov(np.matrix([[cov_00, 0.0], [0.0, cov_11]])) else: pos = self.filter_xy.x_est + self.filter_xy.P_est = np.matrix(1e50 * np.eye(2)) # reset estimate when lost x = pos.item((0, 0))