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 objectCoordinate
public void move(int leftSpeed, int rightSpeed)
MotionControllerException
move(int, int, int)
public void move(int leftSpeed, int rightSpeed, int duration)
MotionControllerException
move(int, int, double)
public void rotate(int speed)
MotionControllerException
rotate(int, double)
public void rotate(int speed, int duration)
MotionControllerException
rotate(int, double)
public void rotate(int speed, double duration)
speed
- the value for speed, [ROBOT_SPEED_MIN, ROBOT_SPEED_MAX]duration
- the duration, in msMotionControllerException
public 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]MotionControllerException
public 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]MotionControllerException
public void moveDistance(int speed, int distance)
speed
- the value for speed, [±ROBOT_SPEED_MIN, ±ROBOT_SPEED_MAX]distance
- the distance as integerMotionControllerException
public void moveDistance(int speed, double distance)
speed
- the value for speed, [±ROBOT_SPEED_MIN, ±ROBOT_SPEED_MAX]distance
- the distance as double, > 0MotionControllerException
public void move(int leftSpeed, int rightSpeed, double duration)
leftSpeed
- Left motor speedrightSpeed
- Right motor speedduration
- Duration, in msMotionControllerException