lejos.robotics
Class Movement

java.lang.Object
  extended by lejos.robotics.Movement

public class Movement
extends Object

Models a movement performed by a pilot

Author:
Lawrie Griffiths

Nested Class Summary
static class Movement.MovementType
          The type of movement made in sufficient detail to allow errors in the movement to be modelled.
 
Field Summary
protected  float angleTurned
           
protected  float arcRadius
           
protected  float distanceTraveled
           
protected  boolean isMoving
           
protected  Movement.MovementType movementType
           
protected  long timeStamp
           
 
Constructor Summary
Movement(Movement.MovementType type, float distance, float angle, boolean isMoving)
          Create a movement object to record a movement made by a pilot
 
Method Summary
 float getAngleTurned()
          Get the angle turned by a rotate or an arc operation.
 float getArcRadius()
          Get the radius of the arc
 float getDistanceTraveled()
          Get the distance traveled.
 Movement.MovementType getMovementType()
          Get the type of the movement performed
 boolean isMoving()
          Test if move was in progress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

distanceTraveled

protected float distanceTraveled

angleTurned

protected float angleTurned

movementType

protected Movement.MovementType movementType

arcRadius

protected float arcRadius

isMoving

protected boolean isMoving

timeStamp

protected long timeStamp
Constructor Detail

Movement

public Movement(Movement.MovementType type,
                float distance,
                float angle,
                boolean isMoving)
Create a movement object to record a movement made by a pilot

Parameters:
type - the movement type
distance - the distance traveled in pilot units
angle - the angle turned in degrees
isMoving - true iff the movement was created while the robot was moving
Method Detail

getDistanceTraveled

public float getDistanceTraveled()
Get the distance traveled. This can be in a straight line or an arc path.

Returns:
the distance traveled

getAngleTurned

public float getAngleTurned()
Get the angle turned by a rotate or an arc operation.

Returns:
the angle turned

getMovementType

public Movement.MovementType getMovementType()
Get the type of the movement performed

Returns:
the movement type

getArcRadius

public float getArcRadius()
Get the radius of the arc

Returns:
the radius of the arc

isMoving

public boolean isMoving()
Test if move was in progress

Returns:
true iff the robot was moving when this Movement object was created