Changeset 262


Ignore:
Timestamp:
01/04/2010 03:30:09 PM (11 years ago)
Author:
dave
Message:

some comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libs/magicsquares/in-progress/pf/src/ParticleFilter.cpp

    r261 r262  
    111111                i!=m_Particles.end(); ++i) 
    112112        {        
    113                 // assign the weight to each particle, based on the  
     113                // Assign the weight to each particle, based on the difference  
     114                // between the one observation from the outside world, and the  
     115                // observation of the particle's state 
    114116                Observation PObs=i->m_State.Observe(); 
    115117                 
     
    118120                float DistErr = (Obs.Dist-PObs.Dist)+(m_ObsDistNoiseLevel*GaussianNoise()); 
    119121                 
    120                 i->m_Weight =1/(AngErr*AngErr*0.1 + DistErr*DistErr); 
     122                // Here we can use information about our sensor to modify the error from 
     123                // different readings. We'll make it so the angle observation is less 'trustworthy' 
     124                // than the distance readings. This has the effect of making the pdf into a cresent  
     125                // shape. 
     126                i->m_Weight = 1/(AngErr*AngErr*0.1 + DistErr*DistErr); 
    121127                TotalWeight+=i->m_Weight; 
    122128        } 
     
    129135        } 
    130136         
    131         // Find the weighted average (this is our result) 
     137        // Find the weighted average to get an estimate 
    132138        State ret; 
    133139        ret.x=0; ret.y=0; 
Note: See TracChangeset for help on using the changeset viewer.