public class Robot extends Object implements RemotelyControllable
Robot
through a
Bluetooth connectionModifier 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 RemotelyControllable
distance
- The distance to moveIOException
RemotelyControllable.translate(double)
public void translateForward() throws IOException
Robot.translateForward()
translateForward
in interface RemotelyControllable
IOException
RemotelyControllable.translateForward()
public void translateBackward() throws IOException
Robot.translateBackward()
translateBackward
in interface RemotelyControllable
IOException
RemotelyControllable.translateBackward()
public void rotate(double angle) throws IOException
Robot.rotate(double)
rotate
in interface RemotelyControllable
angle
- The wanted angle of rotation in degreesIOException
RemotelyControllable.rotate(double)
public void rotateRight() throws IOException
Robot.rotateRight()
rotateRight
in interface RemotelyControllable
IOException
RemotelyControllable.rotateRight()
public void rotateLeft() throws IOException
Robot.rotateLeft()
rotateLeft
in interface RemotelyControllable
IOException
RemotelyControllable.rotateLeft()
public RangeReadings scan() throws IOException
Robot.scan()
Prints the range readings to stdout
scan
in interface RemotelyControllable
RangeReadings
taken the
angles specified.IOException
RemotelyControllable.scan()
public void end() throws IOException
Robot.end()
Closes Bluetooth connection
end
in interface RemotelyControllable
IOException
RemotelyControllable.end()
Licensed under the New BSD License
Thu Nov 15 18:47:59 CST 2012