|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.robotics.localization.MCLParticleSet
public class MCLParticleSet
Represents a particle set for the particle filtering algorithm.
Field Summary | |
---|---|
static int |
maxIterations
|
Constructor Summary | |
---|---|
MCLParticleSet(RangeMap map,
int numParticles,
int border)
Create a set of particles randomly distributed with the given map. |
Method Summary | |
---|---|
void |
applyMove(Movement move)
Apply a move to each particle |
void |
calculateWeights(RangeReadings rr,
RangeMap map)
Calculate the weight for each particle |
void |
dumpClosest(RangeReadings rr,
RangeMap map,
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. |
float |
getBorder()
Get the border where particles should not be generated |
Rectangle |
getErrorRect()
Return the minimum rectangle enclosing all the particles |
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 |
MCLParticle |
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 |
void |
printMaxWeight()
|
boolean |
resample()
Resample the set picking those with higher weights. |
void |
resetEstimate()
Reset the estimated position to unknown |
void |
setAngleNoiseFactor(float factor)
Set the distance angle factor |
void |
setBorder(int border)
Set border where no particles should be generated |
void |
setDebug(boolean debug)
Set system out debugging on or off |
void |
setDistanceNoiseFactor(float factor)
Set the distance noise factor |
void |
setMaxIterations(int max)
Set the maximum iterations for the resample algorithm |
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
Constructor Detail |
---|
public MCLParticleSet(RangeMap map, int numParticles, int border)
map
- the map of the enclosed environmentMethod Detail |
---|
public int numParticles()
public void setDebug(boolean debug)
debug
- true to set debug, false to set it offpublic MCLParticle getParticle(int i)
i
- the index of the particle
public boolean resample()
public void calculateWeights(RangeReadings rr, RangeMap map)
rr
- the robot range readingspublic void printMaxWeight()
public void applyMove(Movement move)
move
- the move to applypublic Pose getEstimatedPose()
public float getMinX()
public float getMaxX()
public float getMinY()
public float getMaxY()
public void resetEstimate()
public Rectangle getErrorRect()
public float getMaxWeight()
public float getBorder()
public void setBorder(int border)
border
- the borderpublic void setSigma(float sigma)
sigma
- the standard deviationpublic void setDistanceNoiseFactor(float factor)
factor
- the distance noise factorpublic void setAngleNoiseFactor(float factor)
factor
- the distance angle factorpublic 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 input stream
IOException
public void dumpClosest(RangeReadings rr, RangeMap map, 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 |