Esempio n. 1
0
    def __init__(self, map_file, num, alpha, log_file_path, r_step, s_search):

        print 'Intializing particle filter'
        # TODO: load the map first
        self.visuvalize = visuvalize.Visuvalize(map_file, r_step, s_search)
        self.rotation_step = int(r_step)

        # initialize set of particles
        self.particles = []

        # read logs and based on the data propogate or update
        self.d = read_log_data.DataReader(log_file_path)

        # number of particles
        self.num = num

        # alphas for motion  model
        self.alpha = alpha

        # initial odom
        self.initial_odom = np.array([0, 0, 0])

        # check if the robot has moved to do resmapling
        self.isMoved = False
        self.start = True
        self.laser_count = 0

        self.z_test = []

        # read distance table
        self.z_required = np.load('distance_table.npy', mmap_mode='r')

        # generate random particles
        self.generate_particles = False
    def __init__(self, map_file, num, alpha, log_file_path, r_step, s_search):

        print 'Intializing particle filter'
        # TODO: load the map first
        self.visuvalize = visuvalize.Visuvalize(map_file, r_step, s_search)
        self.rotation_step = int(r_step)

        # initialize set of particles
        self.particles = []

        # read logs and based on the data propogate or update
        self.d = read_log_data.DataReader(log_file_path)

        # number of particles
        self.num = num

        # alphas for motion  model
        self.alpha = alpha

        # initial odom
        self.initial_odom = np.array([0, 0, 0])

        # check if the robot has moved to do resmapling
        self.isMoved = False
        self.start = True
        self.laser_count = 0

        self.z_test = []

        # read distance table
        self.z_required = np.load('distance_table.npy', mmap_mode='r')

        # generate random particles
        self.generate_particles = False

        # laser data
        self.ll = []

        #img count
        self.img_count = 0

        # for using vectorization
        self.particles_weight = np.ones(self.num) * 1.0 / self.num
        self.particles_pose = np.ndarray(shape=(self.num, 3), dtype=float)

        # initialize the motion model and mesurement model
        self.motion_model = motion_model.MotionModel(alpha, [0, 0, 0],
                                                     'normal')

        # measeurement model
        self.measurement_model = measurement_model.MeasurementModel(
            self.visuvalize.global_map, self.visuvalize.distance_table,
            self.rotation_step)
    def __init__(self, map_file, num, alpha, log_file_path, r_step, s_search):

        print 'Intializing particle filter'
        # TODO: load the map first
        self.visuvalize = visuvalize.Visuvalize(map_file, r_step, s_search)
        self.rotation_step = int(r_step)

        # initialize set of particles
        self.particles = []

        # read logs and based on the data propogate or update
        self.d = read_log_data.DataReader(log_file_path)

        # number of particles
        self.num = num

        # alphas for motion  model
        self.alpha = alpha

        # initial odom
        self.initial_odom = np.array([0, 0, 0])

        # check if the robot has moved to do resmapling
        self.isMoved = False