From 8051fa3096d6f4fb07977ba503557b6e4f263006 Mon Sep 17 00:00:00 2001 From: JIMYL Date: Mon, 26 Oct 2015 22:32:38 +0800 Subject: [PATCH] Fix systemic_resample float indexes indexes should be created as INT array --- code/RobotLocalizationParticleFilter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/RobotLocalizationParticleFilter.py b/code/RobotLocalizationParticleFilter.py index 6b4285a..67d9bef 100644 --- a/code/RobotLocalizationParticleFilter.py +++ b/code/RobotLocalizationParticleFilter.py @@ -165,7 +165,7 @@ def residual_resample2(w): def systemic_resample(w): N = len(w) Q = np.cumsum(w) - indexes = np.zeros(N) + indexes = np.zeros(N, 'int') t = np.linspace(0, 1-1/N, N) + random()/N i, j = 0, 0