|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.robotics.navigation.SimpleNavigator lejos.robotics.localization.TachoLocalizer
public abstract class TachoLocalizer
An abstract extension to TachoNavigator that uses a map and a set of particles to implement the Monte Carlo Localization algorithm to estimate the pose of the robot as it moves about. Note that the navigator uses its own local coordinates relative to the robot's starting position, whereas the estimated pose is in global coordinates, as used by the map. This class must be extended and the takeReadings method implemented. Note that only travel and rotate methods update the particle set.
Field Summary | |
---|---|
protected float |
angle
|
protected float |
distance
|
protected boolean |
isMoving
|
protected RangeMap |
map
|
protected Movement |
mv
|
protected int |
numParticles
|
protected int |
numReadings
|
protected MCLParticleSet |
particles
|
protected float |
projection
|
protected RangeReadings |
readings
|
Constructor Summary | |
---|---|
TachoLocalizer(RangeMap map,
int numParticles,
int numReadings,
float wheelDiameter,
float trackWidth,
Motor leftMotor,
Motor rightMotor,
float projection,
boolean reverse)
|
Method Summary | |
---|---|
Pose |
getEstimatedPose()
Get the estimated position and angle of the robot. |
RangeMap |
getMap()
Get the map |
MCLParticleSet |
getParticles()
Get the particle set |
float |
getProjection()
Get the forward projection of the robot |
RangeReadings |
getReadings()
Return readings |
int |
numParticles()
Get the number of particles |
void |
rotate(float angle,
boolean immediateReturn)
Rotates the NXT robot through a specific number of degrees in a direction (+ or -). |
abstract void |
takeReadings()
|
void |
travel(float distance,
boolean immediateReturn)
Moves the NXT robot a specific distance. |
void |
updatePosition()
Update the robot position and apply it to all the particles. |
Methods inherited from class lejos.robotics.navigation.SimpleNavigator |
---|
angleTo, arc, arc, arc, backward, distanceTo, forward, getAngle, getHeading, getPose, getX, getY, goTo, goTo, isMoving, rotate, rotateLeft, rotateRight, rotateTo, rotateTo, setMoveSpeed, setPose, setPose, setPosition, setTurnSpeed, steer, steer, steer, stop, travel, travelArc, travelArc, updatePose |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RangeReadings readings
protected float projection
protected RangeMap map
protected int numParticles
protected MCLParticleSet particles
protected float angle
protected float distance
protected Movement mv
protected int numReadings
protected boolean isMoving
Constructor Detail |
---|
public TachoLocalizer(RangeMap map, int numParticles, int numReadings, float wheelDiameter, float trackWidth, Motor leftMotor, Motor rightMotor, float projection, boolean reverse)
Method Detail |
---|
public abstract void takeReadings()
public void rotate(float angle, boolean immediateReturn)
SimpleNavigator
rotate
in class SimpleNavigator
angle
- Angle to rotate in degrees. A positive value rotates left, a negative value right.immediateReturn
- if true, the method returns immediatelypublic void travel(float distance, boolean immediateReturn)
SimpleNavigator
travel
in class SimpleNavigator
distance
- The positive or negative distance to move the robot, same units as _wheelDiameterimmediateReturn
- if true, the method returns immediatelypublic void updatePosition()
updatePosition
in class SimpleNavigator
public float getProjection()
public int numParticles()
public MCLParticleSet getParticles()
public RangeMap getMap()
public Pose getEstimatedPose()
public RangeReadings getReadings()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |