class Robot extends Object implements RemotelyControllable
Modifier and Type | Field and Description |
---|---|
(package private) DifferentialPilot |
pilot
Instance of the Pilot mechanism to control the Explorer movements
|
(package private) double |
rotationMagnitude
Magnitude of rotation in degrees of methods
rotateRight() and rotateLeft() specified by the
rotationMagnitude argument in Robot(double, double, boolean, double, double, double) |
(package private) RotatingRangeScanner |
scanner
Abstraction of the Explorer's ultrasonic sensor
|
(package private) double |
translationMagnitude
Magnitude of translation in mm of methods
translateForward() and translateBackward() specified by the
translationMagnitude argument in Robot(double, double, boolean, double, double, double) |
CLOSING_CONN_MSG, SCANNING_ANGLES
Constructor and Description |
---|
Robot(double wheelDiameter,
double trackWidth,
boolean reverse,
double rotationSpeed,
double translationMagnitude,
double rotationMagnitude) |
Modifier and Type | Method and Description |
---|---|
void |
end()
End the connection and exit the
RobotApp
program |
void |
rotate(double angle)
Wait until rotation is done
|
void |
rotateLeft()
Rotate to the left
rotationMagnitude mm, wait until
rotation is done |
void |
rotateRight()
Rotate to the right
rotationMagnitude mm, wait until
rotation is done |
RangeReadings |
scan()
Scan the environment for object detection
|
void |
translate(double distance)
Wait until translation is done
|
void |
translateBackward()
Translate backward
translationMagnitude mm, wait until
translation is done |
void |
translateForward()
Translate forward
translationMagnitude mm, wait until
translation is done |
RotatingRangeScanner scanner
DifferentialPilot pilot
double translationMagnitude
translateForward()
and translateBackward()
specified by the
translationMagnitude
argument in Robot(double, double, boolean, double, double, double)
double rotationMagnitude
rotateRight()
and rotateLeft()
specified by the
rotationMagnitude
argument in Robot(double, double, boolean, double, double, double)
public Robot(double wheelDiameter, double trackWidth, boolean reverse, double rotationSpeed, double translationMagnitude, double rotationMagnitude)
wheelDiameter
- Diameter of the tires in mmtrackWidth
- Distance between center of right tire and
center of left tire in mmreverse
- If true, the NXT robot moves forward when the
motors are running backwardrotationSpeed
- Rotation speed of the vehicle, in degrees
per secondtranslationMagnitude
- Magnitude of translation in mm of methods
translateForward()
and translateBackward()
rotationMagnitude
- Magnitude of rotation in degrees of methods
rotateRight()
and rotateLeft()
public void translate(double distance)
translate
in interface RemotelyControllable
distance
- The distance to moveRemotelyControllable.translate(double)
public void translateForward()
translationMagnitude
mm, wait until
translation is donetranslateForward
in interface RemotelyControllable
RemotelyControllable.translateForward()
public void translateBackward()
translationMagnitude
mm, wait until
translation is donetranslateBackward
in interface RemotelyControllable
RemotelyControllable.translateBackward()
public void rotate(double angle)
rotate
in interface RemotelyControllable
angle
- The wanted angle of rotation in degreesRemotelyControllable.rotate(double)
public void rotateRight()
rotationMagnitude
mm, wait until
rotation is donerotateRight
in interface RemotelyControllable
RemotelyControllable.rotateRight()
public void rotateLeft()
rotationMagnitude
mm, wait until
rotation is donerotateLeft
in interface RemotelyControllable
RemotelyControllable.rotateLeft()
public void end() throws RuntimeException
RobotApp
programend
in interface RemotelyControllable
RuntimeException
RemotelyControllable.end()
public RangeReadings scan()
RemotelyControllable
Scanning angles specified by RemotelyControllable.SCANNING_ANGLES
.
scan
in interface RemotelyControllable
RangeReadings
taken the
angles specified.RemotelyControllable.scan()
Licensed under the New BSD License
Thu Nov 15 18:47:59 CST 2012