Skip to content

Commit a42e4c6

Browse files
robofobrobofob
robofob
authored and
robofob
committed
Merge branch 'devel-noetic' of https://github.com/Extended-Object-Detection-ROS/object_spatial_tools_ros into devel-noetic
2 parents 0bde85b + 81e0534 commit a42e4c6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/object_spatial_tools_ros/robot_kf_undirected_object_tracker.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, x_start, t_start, Q_diag, R_diag, k_decay, color, score):
3030
self.x = np.array([x_start[0], x_start[1], 0.0, 0.0])
3131
self.last_t = t_start
3232
self.last_upd_t = t_start
33-
self.last_soft_update = None
33+
self.last_soft_update = t_start
3434
self.Q = np.diag(Q_diag)
3535
self.R = np.diag(R_diag)
3636
self.k_decay = k_decay
@@ -81,10 +81,10 @@ def predict(self, t):
8181
def update(self, z, t, score, soft = False):
8282
self.last_upd_t = t
8383

84-
if soft:
84+
if not soft:
8585
self.last_soft_update = t
86-
else:
87-
self.last_soft_update = None
86+
#else:
87+
#self.last_soft_update = None
8888

8989
y = z - np.matmul(self.H, self.x)
9090

@@ -167,7 +167,9 @@ def process(self, event):
167167
for i, kf in enumerate(kfs):
168168

169169
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}")
171173

172174
if regular_cond and soft_cond:
173175
kf.predict(now)

0 commit comments

Comments
 (0)