uwcse.location.core
Class ParticleFilterTracker

java.lang.Object
  |
  +--uwcse.location.core.Tracker
        |
        +--uwcse.location.core.MobileTracker
              |
              +--uwcse.location.core.ParticleFilterTracker

public class ParticleFilterTracker
extends MobileTracker

A class containing functionality to track a physical object or set of grouped physical objects with a particle filter representing the location probability distribution and a motion model represents the object's motion patterns. A ParticleFilterTracker is thread safe.

Version:
$Revision: 1.8 $
Author:
Jeffrey Hightower
See Also:
Sample

Field Summary
protected  boolean m_adaptiveOn
           
protected  int m_maxSampleCnt
           
protected  int m_minSampleCnt
           
protected  Random m_random
           
protected  boolean m_resettingOn
           
 
Fields inherited from class uwcse.location.core.MobileTracker
m_motionModel
 
Fields inherited from class uwcse.location.core.Tracker
m_elapsedTime, m_lastMeasurement, m_lastUpdateTime, m_trueStateMeasurement, m_worldMap
 
Constructor Summary
ParticleFilterTracker(ParticleFilterTracker tracker)
          Create a particle filter object tracker as a copy of this one.
ParticleFilterTracker(WorldMap map, MotionModel motion)
          Create a particle filter tracker.
 
Method Summary
 Object clone()
          Create a particle filter object tracker as a copy of the given one.
 LocationReport createLocationReport()
          Compute a location report for the object being tracked based on the entire sum of knowledge from the particle filter.
 int getDesiredNumberOfSamples()
          Get the desired sample count to best represent the current distribution given this filter's current number of bins with support from the occupancy grid.
static int getDesiredNumberOfSamples(int binsWithSupport)
          Compute the chi square value using the specified number of bins of support from the occupancy grid to determine the new desired number of samples after this iteration.
 int getMaxNumberOfSamples()
          Get the maximum number of samples this sample set can contain.
 int getMinNumberOfSamples()
          Get the minimum number of samples this sample set can contain.
 int getNumberOfSamples()
          Get the number of Samples currently in this filter.
 List getRandomSamples(int cnt)
          Generate a List of cnt Samples drawn at random from the existing list respecting the weights.
 void initGaussianDistribution(State mean)
          Initialize the samples in this filter according to the given mean inside the bounding box and set all the weights to a uniform value (1/getNumberOfSamples()).
 void initGaussianDistribution(State mean, Vector3d posSD, Vector3d rotSD)
          Initialize the samples in this filter according to the given mean and stdDev inside the bounding box and set all the weights to a uniform value (1/getNumberOfSamples()).
 void initLocation(LocationReport report)
          Initialize the tracker to the given location.
 void initPartialGaussianDistribution(State mean, Vector3d posSD, Vector3d rotSD, double fractionOfUniformSamples)
          Initialize the samples in this filter according to the given mean and stdDev inside the WorldMap and set all the weights to a uniform value (1 / getNumberOfSamples()).
 void initPartialGaussianDistribution(State mean, Vector3d posSD, Vector3d rotSD, double fractionOfUniformSamples, Point3d lowerCorner, Point3d upperCorner)
          Initialize the samples in this filter according to the given mean and stdDev inside specified min/max bounding box and set all the weights to a uniform value (1 / getNumberOfSamples()).
 void initUniformDistribution()
          Initialize the samples in this filter according to a uniform distribution inside the the WorldMap and set all the weights to a uniform value (1/getNumberOfSamples()).
 void initUniformDistribution(Point3d lowerCorner, Point3d upperCorner)
          Initialize the samples in this filter according to a uniform distribution inside the specified bounding box and set all the weights to a uniform value (1/getNumberOfSamples()).
 void merge(Tracker tracker)
          Compute the root-mean-square error of the position estimate of this particle filter tracker against the last known ground truth TrueStateMeasurement.
 String toString()
          Return a string representation of this particle filter tracker.
 void update(Measurement meas, LocationSensor sensor, LocationReport sensorLocation)
          Update the particle filter to reflect the given measurement taken by the given location sensor.
 
Methods inherited from class uwcse.location.core.MobileTracker
getMotionModel, setMotionModel
 
Methods inherited from class uwcse.location.core.Tracker
getLastMeasurement, getRMSError, getTimestamp, getTrueStateMeasurement, getWorldMap, setTrueStateMeasurement
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_random

protected Random m_random

m_maxSampleCnt

protected int m_maxSampleCnt

m_minSampleCnt

protected int m_minSampleCnt

m_adaptiveOn

protected boolean m_adaptiveOn

m_resettingOn

protected boolean m_resettingOn
Constructor Detail

ParticleFilterTracker

public ParticleFilterTracker(WorldMap map,
                             MotionModel motion)
Create a particle filter tracker.


ParticleFilterTracker

public ParticleFilterTracker(ParticleFilterTracker tracker)
Create a particle filter object tracker as a copy of this one. To merge in a another tracker because of a physical connection between two tracked objects use merge() instead.

See Also:
merge(Tracker)
Method Detail

clone

public Object clone()
Create a particle filter object tracker as a copy of the given one.

Overrides:
clone in class Object

update

public void update(Measurement meas,
                   LocationSensor sensor,
                   LocationReport sensorLocation)
Update the particle filter to reflect the given measurement taken by the given location sensor. Sets the weights of the samples according to the given LocationSensor's likelihood of generating the given Measurement then applies motion and resamples.

Overrides:
update in class Tracker

createLocationReport

public LocationReport createLocationReport()
Compute a location report for the object being tracked based on the entire sum of knowledge from the particle filter.


toString

public String toString()
Return a string representation of this particle filter tracker.

Overrides:
toString in class MobileTracker

initLocation

public void initLocation(LocationReport report)
Initialize the tracker to the given location.


initUniformDistribution

public void initUniformDistribution()
Initialize the samples in this filter according to a uniform distribution inside the the WorldMap and set all the weights to a uniform value (1/getNumberOfSamples()). Noise is assumed to be independent in all dimensions.


initUniformDistribution

public void initUniformDistribution(Point3d lowerCorner,
                                    Point3d upperCorner)
Initialize the samples in this filter according to a uniform distribution inside the specified bounding box and set all the weights to a uniform value (1/getNumberOfSamples()). Noise is assumed to be independent in all dimensions.


initGaussianDistribution

public void initGaussianDistribution(State mean)
Initialize the samples in this filter according to the given mean inside the bounding box and set all the weights to a uniform value (1/getNumberOfSamples()). Noise is assumed to be independent in all dimensions. Standard deviation is automatically chosen according to the heuristic of horizontal 2% of the world map size and 45 degree rotational.


initGaussianDistribution

public void initGaussianDistribution(State mean,
                                     Vector3d posSD,
                                     Vector3d rotSD)
Initialize the samples in this filter according to the given mean and stdDev inside the bounding box and set all the weights to a uniform value (1/getNumberOfSamples()). Noise is assumed to be independent in all dimensions and we get a dirac distribution if the standard deviation of the noise is zero in all dimension.

Parameters:
mean - The mean from which Gaussian white noise is added to the samples.
posSD - standard deviation of the positional noise
rotSD - standard deviation of the Euler angle rotational noise

initPartialGaussianDistribution

public void initPartialGaussianDistribution(State mean,
                                            Vector3d posSD,
                                            Vector3d rotSD,
                                            double fractionOfUniformSamples)
Initialize the samples in this filter according to the given mean and stdDev inside the WorldMap and set all the weights to a uniform value (1 / getNumberOfSamples()). Noise is assumed to be independent in all dimensions and we get a dirac distribution if the standard deviation of the noise is zero in all dimension.

Parameters:
mean - The mean from which Gaussian white noise is added to the samples.
posSD - standard deviation of the positional noise
rotSD - standard deviation of the Euler angle rotational noise
fractionOfUniformSamples - A percentage in the range [0..1]. This percentage of the samples will be set according to a uniform distribution instead of a Gaussian. A value of 0 results in a pure Gaussian while a value of 1 results in a completely uniform distribution.

initPartialGaussianDistribution

public void initPartialGaussianDistribution(State mean,
                                            Vector3d posSD,
                                            Vector3d rotSD,
                                            double fractionOfUniformSamples,
                                            Point3d lowerCorner,
                                            Point3d upperCorner)
Initialize the samples in this filter according to the given mean and stdDev inside specified min/max bounding box and set all the weights to a uniform value (1 / getNumberOfSamples()). Noise is assumed to be independent in all dimensions and we get a dirac distribution if the standard deviation of the noise is zero in all dimension.

Parameters:
mean - The mean from which Gaussian white noise is added to the samples.
posSD - standard deviation of the positional noise
rotSD - standard deviation of the Euler angle rotational noise
fractionOfUniformSamples - A percentage in the range [0..1]. This percentage of the samples will be set according to a uniform distribution instead of a Gaussian. A value of 0 results in a pure Gaussian while a value of 1 results in a completely uniform distribution.
lowerCorner - lower corner of the bounding box
upperCorner - upper corner of the bounding box

getNumberOfSamples

public int getNumberOfSamples()
Get the number of Samples currently in this filter.


getMaxNumberOfSamples

public int getMaxNumberOfSamples()
Get the maximum number of samples this sample set can contain. This value is the number of samples that were specified when the filter was first constructed.


getMinNumberOfSamples

public int getMinNumberOfSamples()
Get the minimum number of samples this sample set can contain.


getRandomSamples

public List getRandomSamples(int cnt)
Generate a List of cnt Samples drawn at random from the existing list respecting the weights. This uses the Stochastic Universal Sampling algorithm.

Returns:
a List of size cnt of Samples

merge

public void merge(Tracker tracker)
Compute the root-mean-square error of the position estimate of this particle filter tracker against the last known ground truth TrueStateMeasurement. Returns Double.NaN if ground truth is unknown (i.e. getTrueStateMeasurement would return null). Incorporate information contained in given tracker into this tracker. Used by the database to link an existing object as a child of another object. A particle filter uses kernel smoothing to merge the given sample set's information into this set. The merge assumes a physical connection of two tracked objects has occurred in that the physical "nearness" of the given sample set is used to perform the merge. For example, this sample set may be tracking an object such as a person and the given sample set is tracking a sensor badge being associated with the person because they picked it up. To actually copy a sample set use the copy constructor instead.


getDesiredNumberOfSamples

public int getDesiredNumberOfSamples()
Get the desired sample count to best represent the current distribution given this filter's current number of bins with support from the occupancy grid. This method will work even when the filter is non-adaptive (i.e. it will return the number of samples the adaptive algorithm would choose at any given iteration). This method ignores specified maximum and minimum sample counts. Refer to the KLD adaptive sampling paper by Dieter Fox for a discussion and derivation of this computation.


getDesiredNumberOfSamples

public static int getDesiredNumberOfSamples(int binsWithSupport)
Compute the chi square value using the specified number of bins of support from the occupancy grid to determine the new desired number of samples after this iteration. Refer to the KLD adaptive sampling paper by Dieter Fox for a discussion and derivation of this computation.



This documentation is for the Location Stack v0.8. The latest distribution, the documentation, and the list of contributors to the Location Stack can always be found at http://portolano.cs.washington.edu/projects/location/

© Copyright 2004 University of Washington CSE