|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlejos.robotics.localization.MCLPoseProvider
public class MCLPoseProvider
Maintains an estimate of the robot pose using sensor data. It uses Monte Carlo
Localization (See section 8.3 of "Probabilistic Robotics" by Thrun et al.
Uses a MCLParticleSet
to represent the probability distribution of the
estimated pose.
It uses a MoveProvider
to supply odometry
data whenever a movement is completed,
from which the Pose
of each particle is updated.
It then uses a RangeScanner
to provide
RangeReadings
which are used, together with the
RangeMap
to calculate the
probability weight of each MCLParticle
.
Constructor Summary | |
---|---|
MCLPoseProvider(MoveProvider mp,
RangeScanner scanner,
RangeMap map,
int numParticles,
int border)
Allocates a new MCLPoseProvider. |
Method Summary | |
---|---|
void |
autoUpdate(boolean yes)
If yes: after a Travel move, the range scanner is requested to get range readings, which are then used to update the particle weights. |
void |
dumpEstimation(java.io.DataOutputStream dos)
Dump the serialized estimate of pose to a data output stream |
void |
generateParticles()
Generate a new particle set, uniformly distributed within the map, and uniformly distributed heading. |
java.awt.Rectangle |
getErrorRect()
Returns the minimum rectangle enclosing all the particles |
float |
getMaxX()
Returns the maximum value of X in the particle set |
float |
getMaxY()
Returns the maximum value of Y in the particle set; |
float |
getMinX()
Returns the minimum value of X in the particle set; |
float |
getMinY()
Returns the minimum value of Y in the particle set; |
MCLParticleSet |
getParticles()
Returns the particle set |
Pose |
getPose()
Returns the best best estimate of the current pose; |
RangeReadings |
getRangeReadings()
Returns most recent range readings |
RangeScanner |
getScanner()
Returns the range scanner |
float |
getSigmaHeading()
Returns the standard deviation of the heading values in the particle set; |
float |
getSigmaX()
Returns the standard deviation of the X values in the particle set; |
float |
getSigmaY()
Returns the standard deviation of the Y values in the particle set; |
float |
getXRange()
Returns the difference between max X and min X |
float |
getYRange()
Return difference between max Y and min Y |
boolean |
incompleteRanges()
returns range scanner failure status |
boolean |
isBusy()
returns true if particle weights are being updated. |
boolean |
isLost()
returns lost status - all particles have very low probability weights |
boolean |
isUpdated()
Returns update success flag |
void |
loadEstimation(java.io.DataInputStream dis)
Load serialized estimated pose from a data input stream |
void |
moveStarted(Move event,
MoveProvider mp)
Required by MoveListener interface; does nothing |
void |
moveStopped(Move event,
MoveProvider mp)
Required by MoveListener interface. |
void |
setDebug(boolean on)
Set debugging on or off |
void |
setInitialPose(Pose aPose,
float radiusNoise,
float headingNoise)
Generates an initial particle set in a circular normal distribution, centered on aPose. |
void |
setInitialPose(RangeReadings readings,
float sigma)
Generates an initial particle set using the range readings. |
void |
setPose(Pose aPose)
|
boolean |
update()
Calls range scanner to get range readings, calculates the probabilities of each particle from the range readings and the map and calls resample(() |
boolean |
update(RangeReadings readings)
Calculates particle weights from readings, then resamples the particle set; |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MCLPoseProvider(MoveProvider mp, RangeScanner scanner, RangeMap map, int numParticles, int border)
mp
- - the MoveProivderscanner
- - the RangeScannermap
- - the RangeMapnumParticles
- number of particlesborder
- of the mapMethod Detail |
---|
public void setInitialPose(Pose aPose, float radiusNoise, float headingNoise)
aPose
- - center of the cloudradiusNoise
- - standard deviation of the radius of the cloudheadingNoise
- - standard deviation of the heading;public void setInitialPose(RangeReadings readings, float sigma)
readings
- sigma
- range reading noise standard deviation.public void setDebug(boolean on)
on
- true = on, false = offpublic void setPose(Pose aPose)
setPose
in interface PoseProvider
public MCLParticleSet getParticles()
public void generateParticles()
public void moveStarted(Move event, MoveProvider mp)
moveStarted
in interface MoveListener
event
- the movementmp
- the movement providerpublic void moveStopped(Move event, MoveProvider mp)
moveStopped
in interface MoveListener
event
- the move just completedmp
- the MoveProviderpublic boolean update()
public boolean update(RangeReadings readings)
readings
-
public boolean isUpdated()
public boolean isLost()
public boolean incompleteRanges()
public float getXRange()
public float getYRange()
public Pose getPose()
getPose
in interface PoseProvider
public RangeReadings getRangeReadings()
public java.awt.Rectangle getErrorRect()
public float getMaxX()
public float getMinX()
public float getMaxY()
public float getMinY()
public float getSigmaX()
public float getSigmaY()
public float getSigmaHeading()
public RangeScanner getScanner()
public void dumpEstimation(java.io.DataOutputStream dos) throws java.io.IOException
dos
- the data output stream
java.io.IOException
public void loadEstimation(java.io.DataInputStream dis) throws java.io.IOException
dis
- the data input stream
java.io.IOException
public void autoUpdate(boolean yes)
yes
- public boolean isBusy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |