Package org.firstinspires.ftc.teamcode
Class MovementAPI
- java.lang.Object
-
- org.firstinspires.ftc.teamcode.MovementAPI
-
public class MovementAPI extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MovementAPI(API api, API.Motor _fl, API.Motor _fr, API.Motor _bl, API.Motor _br)
Initializes the APIMovementAPI(API api, GameMotors motors)
Initializes the API with the motors in the GameMotor enum
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description API.Motor
getBL()
API.Motor
getBR()
API.Motor
getFL()
API.Motor
getFR()
void
move(double direction, double speed)
Moves the robot in a given direction with a given speedvoid
move(double direction, double speed, boolean verbose)
Moves the robot in a given direction with a given speedvoid
move(double powerY, double powerX, double turn, double speed)
Moves the robot given the speed to move forward/back and left/rightvoid
move(double powerY, double powerX, double turn, double speed, boolean verbose)
Moves the robot given the speed to move forward/back and left/rightvoid
setFlipped(boolean flipped)
void
stop()
Stops the robot
-
-
-
Constructor Detail
-
MovementAPI
public MovementAPI(API api, API.Motor _fl, API.Motor _fr, API.Motor _bl, API.Motor _br)
Initializes the API- Parameters:
_fl
- the front-left wheel_fr
- the front-right wheel_bl
- the back-left wheel_br
- the back-right wheel
-
MovementAPI
public MovementAPI(API api, GameMotors motors)
Initializes the API with the motors in the GameMotor enum
-
-
Method Detail
-
getFL
public API.Motor getFL()
-
getFR
public API.Motor getFR()
-
getBL
public API.Motor getBL()
-
getBR
public API.Motor getBR()
-
setFlipped
public void setFlipped(boolean flipped)
-
move
public void move(double powerY, double powerX, double turn, double speed, boolean verbose)
Moves the robot given the speed to move forward/back and left/right- Parameters:
powerY
- the speed to move forward/back, -1 to 1, positive being forwardpowerX
- the speed to move left/right, -1 to 1, positive being to the rightturn
- the speed to turn at, -1 to 1, positive being clockwisespeed
- a multiplier on the final speedverbose
- whether or not to log extra data to telemetry
-
move
public void move(double powerY, double powerX, double turn, double speed)
Moves the robot given the speed to move forward/back and left/right- Parameters:
powerY
- the speed to move forward/back, -1 to 1, positive being forwardpowerX
- the speed to move left/right, -1 to 1, positive being to the rightturn
- the speed to turn at, -1 to 1, positive being clockwisespeed
- a multiplier on the final speed
-
move
public void move(double direction, double speed, boolean verbose)
Moves the robot in a given direction with a given speed- Parameters:
direction
- the direction to move in, in degrees, with positive being left of forwardspeed
- the speed to move atverbose
- whether or not to log extra data to telemetry
-
move
public void move(double direction, double speed)
Moves the robot in a given direction with a given speed- Parameters:
direction
- the direction to move in, in degrees, with positive being left of forwardspeed
- the speed to move at
-
stop
public void stop()
Stops the robot
-
-