@@ -30,7 +30,7 @@ def __init__(self, x_start, t_start, Q_diag, R_diag, k_decay, color, score):
30
30
self .x = np .array ([x_start [0 ], x_start [1 ], 0.0 , 0.0 ])
31
31
self .last_t = t_start
32
32
self .last_upd_t = t_start
33
- self .last_soft_update = None
33
+ self .last_soft_update = t_start
34
34
self .Q = np .diag (Q_diag )
35
35
self .R = np .diag (R_diag )
36
36
self .k_decay = k_decay
@@ -81,10 +81,10 @@ def predict(self, t):
81
81
def update (self , z , t , score , soft = False ):
82
82
self .last_upd_t = t
83
83
84
- if soft :
84
+ if not soft :
85
85
self .last_soft_update = t
86
- else :
87
- self .last_soft_update = None
86
+ # else:
87
+ # self.last_soft_update = None
88
88
89
89
y = z - np .matmul (self .H , self .x )
90
90
@@ -129,7 +129,7 @@ def __init__(self):
129
129
self .Rdiag = rospy .get_param ('~Rdiag' , [0.1 , 0.1 ])
130
130
self .k_decay = rospy .get_param ('~k_decay' , 1 )
131
131
self .lifetime = rospy .get_param ('~lifetime' , 0 )
132
- self .lifetime = rospy .get_param ('~lifetime_soft' , 0 )
132
+ self .lifetime_soft = rospy .get_param ('~lifetime_soft' , 0 )
133
133
self .mahalanobis_max = rospy .get_param ('~mahalanobis_max' , 1 )
134
134
135
135
self .approve_thrash = rospy .get_param ('~approve_thrash' , 1 )
@@ -167,7 +167,9 @@ def process(self, event):
167
167
for i , kf in enumerate (kfs ):
168
168
169
169
regular_cond = self .lifetime == 0 or (now - kf .last_upd_t ) < self .lifetime
170
- soft_cond = (kf .last_soft_update is None ) or (now - kf .last_soft_update ) < self .lifetime_soft
170
+ soft_cond = (now - kf .last_soft_update ) < self .lifetime_soft
171
+
172
+ #rospy.logerr(f"soft cond {soft_cond} time {now} {kf.last_soft_update}")
171
173
172
174
if regular_cond and soft_cond :
173
175
kf .predict (now )
0 commit comments