|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--simworldobjects.BasicSimObject | +--simworldobjects.SimRCX
Simulates an RCX for use in SimWorld
Field Summary | |
static int |
STATE_BACKWARD
|
static int |
STATE_FORWARD
|
static int |
STATE_LEFT
|
static int |
STATE_RIGHT
|
static int |
STATE_STOPPED
|
Constructor Summary | |
SimRCX(SimWorld w,
Controller c)
Constructor: sets up the robot with some predefined parameters |
|
SimRCX(SimWorld w,
Controller c,
double height,
double width,
double length,
java.lang.String type,
double x,
double y,
double z,
double bearingXY,
double bearingXZ)
Constructor: sets up the robot according to the parameters |
Method Summary | |
void |
backward()
Sets the robot moving backwards, this will continue until some other method is called to stop it. |
void |
backward(int time)
Makes the robot move backwards for the given amount of time |
void |
beep()
Makes the robot beep |
void |
forward()
Sets the robot moving forwards, this will continue until some other method is called to stop it. |
void |
forward(int time)
Makes the robot move forwards for the given amount of time |
int |
getSensor1()
Get the current reading of this sensor |
int |
getSensor2()
Get the current reading of this sensor |
int |
getSensor3()
Get the current reading of this sensor |
SimWorld |
getWorld()
|
void |
left()
Sets the robot spinning left, this will continue until some other method is called to stop it. |
void |
left(int time)
Spins the robot left for the given amount of time |
void |
right()
Sets the robot spinning right, this will continue until some other method is called to stop it. |
void |
right(int time)
Spins the robot right for the given amount of time |
void |
stopMoving()
Stops all motors immediately |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int STATE_STOPPED
public static final int STATE_FORWARD
public static final int STATE_BACKWARD
public static final int STATE_RIGHT
public static final int STATE_LEFT
Constructor Detail |
public SimRCX(SimWorld w, Controller c)
w
- the SimWorld where this SimRCX residesc
- the Controller of this SimRCXpublic SimRCX(SimWorld w, Controller c, double height, double width, double length, java.lang.String type, double x, double y, double z, double bearingXY, double bearingXZ)
Method Detail |
public SimWorld getWorld()
public void forward()
forward
in interface AbstractRobot
public void forward(int time)
forward
in interface AbstractRobot
time
- the time in millisecondspublic void backward()
backward
in interface AbstractRobot
public void backward(int time)
backward
in interface AbstractRobot
time
- the time in millisecondspublic void right()
right
in interface AbstractRobot
public void right(int time)
right
in interface AbstractRobot
time
- the time in millisecondspublic void left()
left
in interface AbstractRobot
public void left(int time)
left
in interface AbstractRobot
time
- the time in millisecondspublic void stopMoving()
stopMoving
in interface AbstractRobot
public void beep()
beep
in interface AbstractRobot
public int getSensor1()
getSensor1
in interface AbstractRobot
public int getSensor2()
getSensor2
in interface AbstractRobot
public int getSensor3()
getSensor3
in interface AbstractRobot
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |