Skip to content

Commit

Permalink
fix Kalman filter example
Browse files Browse the repository at this point in the history
  • Loading branch information
rjw57 committed Apr 14, 2016
1 parent 9cefd22 commit 370fcef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion example/kalman_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
# For each time step
for k, z in enumerate(measurements):
# Predict state for this time step
if k != 0:
if kf.time_step is None:
kf.set_initial_state(MultivariateNormal(
mean=np.zeros(STATE_DIM), cov=1e8*np.eye(STATE_DIM)
))
else:
kf.predict()

# Update filter with measurement
Expand Down

0 comments on commit 370fcef

Please sign in to comment.