def add_uncertainty_von_mises(particles_list, sigma, theta_kappa): """Add some noise to each particle in the list. Sigma and theta_kappa is the noise variances for position and angle noise.""" for particle in particles_list: particle.x += rn.randn(0.0, sigma) particle.y += rn.randn(0.0, sigma) particle.theta = np.mod(rn.rand_von_mises(particle.theta, theta_kappa), 2.0 * np.pi) - np.pi
def add_uncertainty(particles_list, sigma, theta_kappa): """Add some noise to each particle in the list. Sigma and theta_kappa is the noise variances for position and angle noise.""" for particle in particles_list: particle.x += rn.randn(0.0, sigma) particle.y += rn.randn(0.0, sigma) particle.theta = np.mod(rn.rand_von_mises (particle.theta, theta_kappa), 2.0 * np.pi) - np.pi