Skip to content

Commit

Permalink
Issue rlabbe#52. Typo in comments.
Browse files Browse the repository at this point in the history
Sample code for residual() was incorrect. I added using the mod
operator to handle any abs(angle) > 2pi.
  • Loading branch information
rlabbe committed Sep 20, 2016
1 parent deac15c commit 4051e83
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions filterpy/kalman/unscented_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ def state_mean(sigmas, Wm):
def residual(a, b):
y = a[0] - b[0]
y = y % (2 * np.pi)
if y > np.pi:
y -= 2*np.pi
if y < -np.pi:
y = 2*np.pi
return y
Expand Down

0 comments on commit 4051e83

Please sign in to comment.