|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.ed.inf.sdp2012.group7.control.RobotControl
public class RobotControl
This class holds the geometric location of our robot but is also responsible for communicating with it.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface uk.ac.ed.inf.sdp2012.group7.control.ConstantsReuse |
|---|
ConstantsReuse.OpCodes |
| Field Summary | |
|---|---|
static org.apache.log4j.Logger |
logger
|
| Fields inherited from interface uk.ac.ed.inf.sdp2012.group7.control.ConstantsReuse |
|---|
ROBOT_MAC, ROBOT_NAME |
| Constructor Summary | |
|---|---|
RobotControl()
|
|
| Method Summary | |
|---|---|
void |
beep()
Commands the robot to make a noise |
void |
changeSpeed(int speed)
Changes the speed the robot is travelling at |
void |
circleWithRadius(int radius,
boolean arcLeft)
Commands the robot to move forwards on an arc with a certain radius from the centre of the robot |
boolean |
isConnected()
|
void |
kick()
Commands the robot to kick |
void |
logResponse(ConstantsReuse.OpCodes response)
|
void |
moveBackward()
Commands the robot to move backward |
void |
moveBackward(int speed)
Commands the robot to move backward at a speed |
void |
moveBackwardDistance(int distance)
Commands the robot to move backward |
void |
moveForward()
Commands the robot to move forward |
void |
moveForward(int speed)
|
void |
moveForwardDistance(int distance)
Commands the robot to move forwards a certain distance |
void |
rotateBy(double radians)
|
void |
rotateBy(double radians,
boolean block)
|
void |
rotateBy(double radians,
boolean block,
boolean left)
Rotates the robot by the given number of radians |
void |
setConnected(boolean isConnected)
|
boolean |
startCommunications()
This method initialises the connection and starts the thread which sends data to the robot |
void |
startMatch()
Commands the robot to move forward indefinitely and start odometry from its initial position (if the bluetooth connection is lost, it'll try to move back to the initial position) |
void |
stop()
Commands the robot to stop where it is |
void |
stopCommunications()
Stops the connection with the Robot |
void |
stopMatch()
Commands the robot to stop movement and recording odometry |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public RobotControl()
| Method Detail |
|---|
public boolean startCommunications()
public void stopCommunications()
public void changeSpeed(int speed)
speed - public void moveForward()
public void moveForward(int speed)
public void moveForwardDistance(int distance)
distance - Measured in cmpublic void moveBackward()
public void moveBackward(int speed)
public void moveBackwardDistance(int distance)
public void stop()
public void kick()
public void rotateBy(double radians,
boolean block,
boolean left)
radians -
public void rotateBy(double radians,
boolean block)
public void rotateBy(double radians)
public void circleWithRadius(int radius,
boolean arcLeft)
radius - arcLeft - If true the robot will go left, otherwise will go rightpublic void beep()
public void startMatch()
public void stopMatch()
public void setConnected(boolean isConnected)
public boolean isConnected()
public void logResponse(ConstantsReuse.OpCodes response)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||