] * NUMBER_OF_PARTICLES # At the start every particle has its intial coords as 0,0,0 p_y = [estimate_y] * NUMBER_OF_PARTICLES p_theta = [estimate_theta] * NUMBER_OF_PARTICLES weights = [ 1.0 / NUMBER_OF_PARTICLES ] * NUMBER_OF_PARTICLES # In an actual example these would be updated mu = 0 # update with actual value # sigma values for 20cm dist and pi/2 rotations sigma_e = 0.1 sigma_f = 0.04519 sigma_g = 0.03490 # from particle Data Structures mymap = world.Map() particles = world.Particles() # for printing for i in range(100): particles.data.append((estimate_x, estimate_y, estimate_theta, weights[0])) world.init_world(mymap) # estimate L01 position based on particles def update_estimate(): global p_x global p_y global p_theta global weights estimate_x = 0.0 estimate_y = 0.0 estimate_theta = 0.0
def __init__(self): self.particles = particleDataStructures.Particles() self.particleSet = self.particles.data self.mymap = particleDataStructures.mymap