public class MotionController
extends java.lang.Object
| Constructor and Description |
|---|
MotionController(Coordinate coordinate)
MotionController class
|
| Modifier and Type | Method and Description |
|---|---|
void |
move(int leftSpeed,
int rightSpeed)
Wrapper for void move(int, int, int)
|
void |
move(int leftSpeed,
int rightSpeed,
double duration)
The core move implementation, using Dead Reckoning algorithm
|
void |
move(int leftSpeed,
int rightSpeed,
int duration)
Wrapper for void move(int, int, double)
|
void |
moveDistance(int speed,
double distance)
Move the robot by given speed for a given distance
|
void |
moveDistance(int speed,
int distance)
Move the robot by given speed for a given distance
|
void |
rotate(int speed)
Wrapper for void rotate(int, double)
|
void |
rotate(int speed,
double duration)
Rotate the robot in given speed for a given duration
|
void |
rotate(int speed,
int duration)
Wrapper for void rotate(int, double)
|
void |
rotateDegree(int speed,
float degree)
Rotate to a given relative angle in degrees, with a given speed
|
void |
rotateRadians(int speed,
float radians)
Rotate to a given relative angle in radians, with a given speed
|
public MotionController(Coordinate coordinate)
coordinate - Coordinate objectCoordinatepublic void move(int leftSpeed,
int rightSpeed)
MotionControllerExceptionmove(int, int, int)public void move(int leftSpeed,
int rightSpeed,
int duration)
MotionControllerExceptionmove(int, int, double)public void rotate(int speed)
MotionControllerExceptionrotate(int, double)public void rotate(int speed,
int duration)
MotionControllerExceptionrotate(int, double)public void rotate(int speed,
double duration)
speed - the value for speed, [ROBOT_SPEED_MIN, ROBOT_SPEED_MAX]duration - the duration, in msMotionControllerExceptionpublic void rotateRadians(int speed,
float radians)
speed - the value for speed, [ROBOT_SPEED_MIN, ROBOT_SPEED_MAX]degree - the relative degree to be rotate, positive means CW, [-180,
180]MotionControllerExceptionpublic void rotateDegree(int speed,
float degree)
speed - the value for speed, [ROBOT_SPEED_MIN, ROBOT_SPEED_MAX]degree - the relative degree to be rotated, positive means CW, [-180,
180]MotionControllerExceptionpublic void moveDistance(int speed,
int distance)
speed - the value for speed, [±ROBOT_SPEED_MIN, ±ROBOT_SPEED_MAX]distance - the distance as integerMotionControllerExceptionpublic void moveDistance(int speed,
double distance)
speed - the value for speed, [±ROBOT_SPEED_MIN, ±ROBOT_SPEED_MAX]distance - the distance as double, > 0MotionControllerExceptionpublic void move(int leftSpeed,
int rightSpeed,
double duration)
leftSpeed - Left motor speedrightSpeed - Right motor speedduration - Duration, in msMotionControllerException