From 4051e838737c63ad8cb1072d376557a3ecdd71e3 Mon Sep 17 00:00:00 2001 From: Roger Labbe Date: Tue, 20 Sep 2016 06:18:17 -0700 Subject: [PATCH] Issue #52. Typo in comments. Sample code for residual() was incorrect. I added using the mod operator to handle any abs(angle) > 2pi. --- filterpy/kalman/unscented_transform.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/filterpy/kalman/unscented_transform.py b/filterpy/kalman/unscented_transform.py index 8019136..c3538f3 100644 --- a/filterpy/kalman/unscented_transform.py +++ b/filterpy/kalman/unscented_transform.py @@ -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