def skyline_config(): '''This function will manage all the tasks related to skyline construction i.e from getting points to finding skyline points and ploting it as well''' # need to get all the points here data_points = random_xy_generator(10, 1, 10, 1, 10) plot.plot_2D(data_points, big) print("all good")
count = 0 for m in measurements: count += 1 if not pf.initialized: # Initialize the particle set using GNSS measurement. pf.initialize(m['gnss_x'], m['gnss_y'], m['gnss_theta'], *pos_std) else: # Prediction step pf.predict(delta_t, m['previous_velocity'], m['previous_yawrate'], *pos_std) # Feed the particle with observations to update weights. observations = [{'x': x, 'y': y} for (x, y) in \ zip (m['measurement_x'], m['measurement_y'])] pf.update_weights(sensor_range, *landmark_std, observations, Map) # Resample particles to capture posterior belief distribution. pf.resample() # Select the best (highest weight) particle; # we will assume that this represents the vehicle's position. particle = pf.get_best_particle() # Print for debugging purposes. print("[%d] %f, %f" % (count, particle['x'], particle['y'])) # Collect data for post-mortem plotting. graph.append({ 'position': (particle['x'], particle['y']), 'particles': [(p['x'], p['y']) for p in pf.particles], 'landmarks': [(Map[l]['x'], Map[l]['y']) \ for l in particle['assoc']], }) # Go plot the results. plot_2D(graph)