|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorbotix.robot.base.RobotControl
public class RobotControl
Provides services for controlling a robot.
Field Summary | |
---|---|
static float |
LED_STATE_OFF
Off state constant used in commands requiring on/off state. |
static float |
LED_STATE_ON
On state constant used in commands requiring on/off state. |
static float |
MAX_JUMP_TIME
Maximum time for running the motors for the boostUncontrolled method. |
Constructor Summary | |
---|---|
RobotControl(Robot robot)
Constructs a robot control for the given robot. |
Method Summary | |
---|---|
void |
boostUncontrolled(float timeInterval)
An un-controlled boost to the motors with the control system turned off. |
void |
boostUnderControl(float timeInterval)
|
void |
drive(double x,
double y,
double z)
Takes accelerometer values and converts them into drive commands. |
DeviceConnection |
getDeviceConnecction()
Accessor to the DeviceConnection object. |
DriveAlgorithm |
getDriveAlgorithm()
Accessor to get the driveAlgorithm used for the drive method. |
Robot |
getRobot()
Accessor to the robot that is under control. |
void |
resetHeading()
|
void |
roll(float heading,
float speed)
Sends a robot moving at the given speed and heading. |
void |
rotate(float heading)
Allow you to rotate the ball without giving any speed. |
void |
setDriveAlgorithm(DriveAlgorithm algorithm)
Accessor to set the driveAlgorithm to be used in the drive method. |
void |
setRGBColor(int red,
int green,
int blue)
Sets a RGB LED on the robot to match the given RGB color values. |
void |
start()
Starts controlling the robotic device. |
void |
startCalibration()
Method to start the calibration sequence. |
void |
stop()
Stop controlling the robotic device. |
void |
stopCalibration(boolean calibrate)
Method to stop the calibration sequence. |
void |
stopMotors()
Stops both motors. |
void |
update(java.util.Observable observable,
java.lang.Object o)
Observer method that monitors for the Robot's name changes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float LED_STATE_OFF
public static final float LED_STATE_ON
public static final float MAX_JUMP_TIME
Constructor Detail |
---|
public RobotControl(Robot robot)
robot
- is the robot to control.Method Detail |
---|
public Robot getRobot()
public DeviceConnection getDeviceConnecction()
public DriveAlgorithm getDriveAlgorithm()
public void setDriveAlgorithm(DriveAlgorithm algorithm)
algorithm
- A DriveAlgorithm object.public void start()
public void stop()
public void stopMotors()
public void drive(double x, double y, double z)
x
- The x-axis acceleration.y
- The y-axis acceleration.z
- The z-axis acceleration.public void startCalibration()
RobotControl.stopCalibration(boolean)
public void stopCalibration(boolean calibrate)
calibrate
- true to send the calibration command and false to abort the calibration.RobotControl.startCalibration()
public void resetHeading()
public void rotate(float heading)
heading
- The heading in degrees to change the heading to.public void roll(float heading, float speed)
heading
- An angle from 0.0 to 360.0 degrees.speed
- A value from 0.0 to 1.0 for speed of the robot.public void setRGBColor(int red, int green, int blue)
red
- A value from 0 to 255 for the red component.green
- A value from 0 to 255 for the green component.blue
- A value from 0 to 255 for the blue component.public void boostUnderControl(float timeInterval)
public void boostUncontrolled(float timeInterval)
timeInterval
- A value from 0 to 1 seconds for the boost.public void update(java.util.Observable observable, java.lang.Object o)
update
in interface java.util.Observer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |