public class Robot extends Object implements RemotelyControllable
Robot through a
Bluetooth connection| Modifier and Type | Field and Description |
|---|---|
private NXTConnector |
conn
Bluetooth NXT connector object
|
private DataInputStream |
dis
Data input stream object
|
private DataOutputStream |
dos
Data output stream object
|
CLOSING_CONN_MSG, SCANNING_ANGLES| Constructor and Description |
|---|
Robot(String nxtName,
String nxtAddr,
NXTCommLogListener logListener,
double wheelDiameter,
double trackWidth,
boolean reverse,
double rotationSpeed,
double translationMagnitude,
double rotationMagnitude)
|
| Modifier and Type | Method and Description |
|---|---|
void |
end()
Invokes
Robot.end() |
void |
rotate(double angle)
Invokes
Robot.rotate(double) |
void |
rotateLeft()
Invokes
Robot.rotateLeft() |
void |
rotateRight()
Invokes
Robot.rotateRight() |
RangeReadings |
scan()
Invokes
Robot.scan() |
void |
translate(double distance)
Invokes
Robot.translate(double) |
void |
translateBackward()
Invokes
Robot.translateBackward() |
void |
translateForward()
Invokes
Robot.translateForward() |
private NXTConnector conn
private DataOutputStream dos
private DataInputStream dis
public Robot(String nxtName, String nxtAddr, NXTCommLogListener logListener, double wheelDiameter, double trackWidth, boolean reverse, double rotationSpeed, double translationMagnitude, double rotationMagnitude)
nxtName - The name of the NXTnxtAddr - The bluetooth address of the NXTlogListener - Log listener attached to the Bluetooth
connectionwheelDiameter - wheelDiameter argument to Robot.Robot(double, double, boolean, double, double, double)trackWidth - trackWidth argument to Robot.Robot(double, double, boolean, double, double, double)reverse - reverse argument to Robot.Robot(double, double, boolean, double, double, double)rotationSpeed - rotationSpeed argument to Robot.Robot(double, double, boolean, double, double, double)translationMagnitude - translationMagnitude argument to
Robot.Robot(double, double, boolean, double, double, double)rotationMagnitude - rotationMagnitude argument to Robot.Robot(double, double, boolean, double, double, double)public void translate(double distance) throws IOException
Robot.translate(double)translate in interface RemotelyControllabledistance - The distance to moveIOExceptionRemotelyControllable.translate(double)public void translateForward() throws IOException
Robot.translateForward()translateForward in interface RemotelyControllableIOExceptionRemotelyControllable.translateForward()public void translateBackward() throws IOException
Robot.translateBackward()translateBackward in interface RemotelyControllableIOExceptionRemotelyControllable.translateBackward()public void rotate(double angle) throws IOException
Robot.rotate(double)rotate in interface RemotelyControllableangle - The wanted angle of rotation in degreesIOExceptionRemotelyControllable.rotate(double)public void rotateRight() throws IOException
Robot.rotateRight()rotateRight in interface RemotelyControllableIOExceptionRemotelyControllable.rotateRight()public void rotateLeft() throws IOException
Robot.rotateLeft()rotateLeft in interface RemotelyControllableIOExceptionRemotelyControllable.rotateLeft()public RangeReadings scan() throws IOException
Robot.scan()
Prints the range readings to stdout
scan in interface RemotelyControllableRangeReadings taken the
angles specified.IOExceptionRemotelyControllable.scan()public void end() throws IOException
Robot.end()
Closes Bluetooth connection
end in interface RemotelyControllableIOExceptionRemotelyControllable.end()Licensed under the New BSD License
Thu Nov 15 18:47:59 CST 2012