|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object icommand.robotics.CompassNavigator
public class CompassNavigator
Not currently implemented. None of these methods will work yet!
Constructor Summary | |
---|---|
CompassNavigator(Compass compass,
double wheelDiameter,
double driveLength,
Motor left,
Motor right)
|
Method Summary | |
---|---|
void |
backward()
Moves the NXT robot backward until stop() is called. |
void |
forward()
Moves the NXT robot forward until stop() is called. |
double |
getAngle()
Returns the current angle the NXT robot is facing. |
float |
getX()
Returns the current x coordinate of the NXT. |
float |
getY()
Returns the current y coordinate of the NXT. |
void |
gotoAngle(double angle)
Rotates the NXT robot to point in a certain direction. |
void |
gotoPoint(double x,
double y)
Rotates the NXT robot towards the target point and moves the required distance. |
void |
rotate(double angle)
Rotates the NXT robot a specific number of degrees in a direction (+ or -).This method will return once the rotation is complete. |
void |
stop()
Halts the NXT robot and calculates new x, y coordinates. |
void |
travel(long distance)
Moves the NXT robot a specific distance. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompassNavigator(Compass compass, double wheelDiameter, double driveLength, Motor left, Motor right)
Method Detail |
---|
public void backward()
Navigator
backward
in interface Navigator
Navigator.stop().
public void forward()
Navigator
forward
in interface Navigator
Navigator.stop().
public double getAngle()
Navigator
getAngle
in interface Navigator
public float getX()
Navigator
getX
in interface Navigator
public float getY()
Navigator
getY
in interface Navigator
public void gotoAngle(double angle)
Navigator
gotoAngle
in interface Navigator
angle
- The angle to rotate to, in degrees.public void gotoPoint(double x, double y)
Navigator
gotoPoint
in interface Navigator
x
- The x coordinate to move to.y
- The y coordinate to move to.public void stop()
Navigator
stop
in interface Navigator
Navigator.forward().
public void rotate(double angle)
Navigator
rotate
in interface Navigator
angle
- Angle to rotate in degrees. A positive value rotates left, a negative value right.public void travel(long distance)
Navigator
travel
in interface Navigator
distance
- The positive or negative distance to move the robot.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |