예제 #1
0
파일: aer_pf.py 프로젝트: AndreaCensi/rcl
class AERPF(Block):
    """ Simple particle filter """
    
    Block.alias('aer_pf')
    
    Block.input('track_log')
    Block.output('particles', 'All particles')
    Block.output('hps', 'A list of coherent hypotheses')
    
    Block.config('min_track_dist', 'Minimum distance between tracks')
    Block.config('max_vel', 'Maximum velocity')
    Block.config('max_bound', 'Largest size of the uncertainty')
    Block.config('max_hp', 'Maximum number of hypotheses to produce.')
    
    def init(self):
        params = dict(max_vel=self.config.max_vel,
                      min_track_dist=self.config.min_track_dist,
                      max_bound=self.config.max_bound)
        self.pdm = ParticleTrackerMultiple(**params)             
     
    def update(self):
        tracks = self.input.track_log
        
        self.pdm.add_observations(tracks)
        
        particles = self.pdm.get_all_particles()
        if len(particles) > 0:
            self.output.particles = particles

            max_hp = self.config.max_hp
            hps = self.pdm.get_coherent_hypotheses(max_hp)
            self.output.hps = hps 
예제 #2
0
class AERPF(Block):
    """ Simple particle filter """

    Block.alias('aer_pf')

    Block.input('track_log')
    Block.output('particles', 'All particles')
    Block.output('hps', 'A list of coherent hypotheses')

    Block.config('min_track_dist', 'Minimum distance between tracks')
    Block.config('max_vel', 'Maximum velocity')
    Block.config('max_bound', 'Largest size of the uncertainty')
    Block.config('max_hp', 'Maximum number of hypotheses to produce.')

    def init(self):
        params = dict(max_vel=self.config.max_vel,
                      min_track_dist=self.config.min_track_dist,
                      max_bound=self.config.max_bound)
        self.pdm = ParticleTrackerMultiple(**params)

    def update(self):
        tracks = self.input.track_log

        self.pdm.add_observations(tracks)

        particles = self.pdm.get_all_particles()
        if len(particles) > 0:
            self.output.particles = particles

            max_hp = self.config.max_hp
            hps = self.pdm.get_coherent_hypotheses(max_hp)
            self.output.hps = hps
예제 #3
0
파일: aer_pf.py 프로젝트: AndreaCensi/rcl
 def init(self):
     params = dict(max_vel=self.config.max_vel,
                   min_track_dist=self.config.min_track_dist,
                   max_bound=self.config.max_bound)
     self.pdm = ParticleTrackerMultiple(**params)             
예제 #4
0
 def init(self):
     params = dict(max_vel=self.config.max_vel,
                   min_track_dist=self.config.min_track_dist,
                   max_bound=self.config.max_bound)
     self.pdm = ParticleTrackerMultiple(**params)