public class OdometryPoseProvider extends java.lang.Object implements PoseProvider, MoveListener, SampleProvider
A PoseProvider keeps track of the robot Pose
.
It does this using odometry (dead reckoning)
data contained in a Move
, which is supplied by a MoveProvider
. When the PoseProivder is constructed, it registers
as listener with its MoveProvider,
Constructor and Description |
---|
OdometryPoseProvider(MoveProvider mp)
Allocates a new OdometryPoseProivder and registers it with the MovePovider as a listener.
|
Modifier and Type | Method and Description |
---|---|
void |
fetchSample(float[] sample,
int offset)
Fetches a sample from a sensor or filter.
|
Pose |
getPose()
returns a new pose that represents the current location and heading of the robot.
|
void |
moveStarted(Move move,
MoveProvider mp)
called by a MoveProvider when movement starts
|
void |
moveStopped(Move move,
MoveProvider mp)
called by a MoveProvider when movement ends
|
int |
sampleSize()
Returns the number of elements in a sample.
The number of elements does not change during runtime. |
void |
setPose(Pose aPose) |
public OdometryPoseProvider(MoveProvider mp)
public Pose getPose()
getPose
in interface PoseProvider
public void moveStarted(Move move, MoveProvider mp)
moveStarted
in interface MoveListener
move
- - the event that just startedmp
- the MoveProvider that called this methodpublic void setPose(Pose aPose)
setPose
in interface PoseProvider
public void moveStopped(Move move, MoveProvider mp)
moveStopped
in interface MoveListener
move
- - the event that just startedmp
- public int sampleSize()
SampleProvider
sampleSize
in interface SampleProvider
public void fetchSample(float[] sample, int offset)
SampleProvider
fetchSample
in interface SampleProvider
sample
- The array to store the sample in.offset
- The elements of the sample are stored in the array starting at the offset position.