|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
dlife.robot.Device
dlife.robot.DeltaPositionEffector
public abstract class DeltaPositionEffector
Abstract base class for effectors that use odometry to move a robot a specified distance forward or backward or rotate it CW or CCW a specified angle.
| Field Summary |
|---|
| Fields inherited from class dlife.robot.Device |
|---|
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount |
| Constructor Summary | |
|---|---|
DeltaPositionEffector()
Creates a new DeltaPositionEffector |
|
| Method Summary | |
|---|---|
protected DeviceDisplay[] |
createGUIObjects()
Construct the DeltaPositionController that will be used as the GUI for this DeltaPositionEffector. |
int |
getAngle()
Get the current angle setting for this DeltaPositionEffector. |
int |
getDistance()
Get the current distance setting for this DeltaPositionEffector. |
double |
getSpeed()
Get the current speed setting for this DeltaPositionEffector. |
abstract boolean |
isDone()
This method is used to check if a robot is done moving to the specified location or finished rotating. |
protected abstract void |
moveRobotDistance(int dist,
double speed)
This method must be implemented in a subclass and is responsible for moving the robot a certain distance at a given speed. |
void |
rotate()
Repeat the last rotation. |
void |
rotate(int angle,
double speed)
Rotate a robot by a certain angle. |
protected abstract void |
rotateRobotAngle(int angle,
double speed)
This method must be implemented in a subclass and is responsible for rotating the rotate by a certain number of degrees at a certain speed. |
void |
setAngle(int newAngle)
Set the angle to be rotated in degrees. |
void |
setDistance(int newDistance)
Set the distance to be traveled in millimeters. |
void |
setSpeed(double newSpeed)
Set the speed for rotation or translation. |
void |
translate()
Translate the robot by the distance returned from getDistance() at the speed returned from getSpeed(). |
void |
translate(int distance,
double speed)
Drives a robot forward or backward by a certain distance at a certain speed. |
| Methods inherited from class dlife.robot.Device |
|---|
freeze, getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getRobot, getSensorReadCount, getSensorReadRate, readStateFromRobot, setAutoRead, setGUIUpdateDelay, setReadDelay, setRobot, shutDown, startAutoReadTimer, startUp, stopAutoReadTimer |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DeltaPositionEffector()
| Method Detail |
|---|
public void translate(int distance,
double speed)
distance - the distance to drive in millimetersspeed - the speed to drivepublic void translate()
public void rotate(int angle,
double speed)
angle - the angle to turn in degreesspeed - the speed to turnpublic void rotate()
public int getDistance()
public void setDistance(int newDistance)
newDistance - the distance to be traveled in millimeters.public int getAngle()
public void setAngle(int newAngle)
newAngle - the angle to be rotated in degrees.public double getSpeed()
public void setSpeed(double newSpeed)
newSpeed - the new speedprotected DeviceDisplay[] createGUIObjects()
createGUIObjects in class Device
protected abstract void moveRobotDistance(int dist,
double speed)
dist - the distance in millimeters to drive the robotspeed - the speed at which to drive
protected abstract void rotateRobotAngle(int angle,
double speed)
angle - the angle given in degreesspeed - the speed at which to rotatepublic abstract boolean isDone()
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||