|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.localization.ParticleSet
public class ParticleSet
Represents a particle set for the particle filtering algorithm.
Field Summary | |
---|---|
static float |
angleNoiseFactor
|
static int |
border
|
static float |
distanceNoiseFactor
|
static int |
forwardReading
|
static int |
maxIterations
|
static int |
numReadings
|
static int |
rangeReadingAngle
|
static float[] |
readings
|
static float |
twoSigmaSquared
|
Constructor Summary | |
---|---|
ParticleSet(Map map,
int numParticles)
Create a set of particles randomly distributed with the given map. |
Method Summary | |
---|---|
void |
applyMove(Move move)
Apply a move to each particle |
void |
calculateWeights(RangeReadings rr,
Map map)
Calculate the weight for each particle |
void |
dumpClosest(DataOutputStream dos,
float x,
float y)
Find the closest particle to specified coordinates and dump its details to a data output stream. |
void |
dumpEstimation(DataOutputStream dos)
Dump the serialized estimate of pose to a data output stream |
void |
dumpParticles(DataOutputStream dos)
Serialize the particle set to a data output stream |
int |
findClosest(float x,
float y)
Find the index of the particle closest to a given co-ordinates |
Pose |
getEstimatedPose()
Get the estimated pose of the robot |
float |
getMaxWeight()
The highest weight of any particle |
float |
getMaxX()
Get the maximum X value of the estimated position |
float |
getMaxY()
Get the maximum Y value of the estimated position |
float |
getMinX()
Get the minimum X value of the estimated position |
float |
getMinY()
Get the minimum Y value of the estimated position |
Particle |
getParticle(int i)
Get a specific particle |
void |
loadEstimation(DataInputStream dis)
Load serialized estimated pose from a data input stream |
void |
loadParticles(DataInputStream dis)
Load serialized particles from a data input stream |
int |
numParticles()
Return the number of particles in the set |
boolean |
resample()
Resample the set picking those with higher weights. |
void |
resetEstimate()
Reset the estimated position to unknown |
static void |
setAngleNoiseFactor(float factor)
Set the distance angle factor |
static void |
setBorder(int border)
Set border |
static void |
setDistanceNoiseFactor(float factor)
Set the distance noise factor |
static void |
setForwardReading(int index)
Set the index of the reading that is straight ahead |
static void |
setMaxIterations(int max)
Set the maximum iterations for the resample algorithm |
static void |
setNumReadings(int num)
Set the number of range readings |
static void |
setRangeReadingAngle(int angle)
Set the range reading angle |
static void |
setSigma(float sigma)
Set the standard deviation for the sensor probability model |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int maxIterations
public static float twoSigmaSquared
public static float distanceNoiseFactor
public static float angleNoiseFactor
public static int numReadings
public static int rangeReadingAngle
public static int forwardReading
public static int border
public static float[] readings
Constructor Detail |
---|
public ParticleSet(Map map, int numParticles)
map
- the map of the enclosed environmentMethod Detail |
---|
public int numParticles()
public Particle getParticle(int i)
i
- the index of the particle
public boolean resample()
public void calculateWeights(RangeReadings rr, Map map)
rr
- the robot range readingspublic void applyMove(Move move)
move
- the move to applypublic Pose getEstimatedPose()
public float getMinX()
public float getMaxX()
public float getMinY()
public float getMaxY()
public void resetEstimate()
public float getMaxWeight()
public static void setBorder(int border)
border
- the border where no particles should be generatedpublic static void setSigma(float sigma)
sigma
- the standard deviationpublic static void setDistanceNoiseFactor(float factor)
factor
- the distance noise factorpublic static void setAngleNoiseFactor(float factor)
factor
- the distance angle factorpublic static void setRangeReadingAngle(int angle)
angle
- the angle between range readingspublic static void setForwardReading(int index)
index
- the forward reading indexpublic static void setNumReadings(int num)
num
- the number of range readingspublic static void setMaxIterations(int max)
max
- the maximum iterationspublic int findClosest(float x, float y)
x
- the x-coordinatey
- the y-coordinate
public void dumpParticles(DataOutputStream dos) throws IOException
dos
- the data output stream
IOException
public void loadParticles(DataInputStream dis) throws IOException
dis
- the data input stream
IOException
public void dumpEstimation(DataOutputStream dos) throws IOException
dos
- the data output stream
IOException
public void loadEstimation(DataInputStream dis) throws IOException
dis
- the data imput stream
IOException
public void dumpClosest(DataOutputStream dos, float x, float y) throws IOException
dos
- the data output streamx
- the x-coordinatey
- the y-coordinate
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |