public interface ControlLayout
ControlLayout
interface should be implemented by anything that represents
a joystick control layout. The responsibility of any control layout is to convert a
joystick state into a forward power and a clockwise power, which are accepted by
movement methods in DriveSystem
.
For example, possibly the most common drive system used in FTC robots is a drive-spin system.
In this scheme, the y-axis of the left thumbstick controls the forward/backward power of the
robot, and the x-axis of the right thumbstick control the clockwise/counter-clockwise spin
of the robot. This is potentially the simplest system, because no math is required to convert
the state of the joystick into the forward and clockwise powers that are accepted by
DriveSystem
.
Modifier and Type | Method and Description |
---|---|
double |
getClockwisePower(Joystick joy)
Gets the clockwise power that should be sent to the robot based on the current
state of the given joystick.
|
double |
getForwardPower(Joystick joy)
Gets the forward power that should be sent to the robot based on the current
state of the given joystick.
|
double getForwardPower(Joystick joy)
joy
- the joystick to use for power calculations.double getClockwisePower(Joystick joy)
joy
- the joystick to use for power calculations.