@TeleOp(name="Squared Drive")
public class SquaredDrive
extends com.qualcomm.robotcore.eventloop.opmode.OpMode
Modifier and Type | Field and Description |
---|---|
(package private) Robot |
robot |
(package private) boolean |
stalled |
(package private) com.qualcomm.robotcore.util.ElapsedTime |
time |
Constructor and Description |
---|
SquaredDrive() |
Modifier and Type | Method and Description |
---|---|
void |
drive(DriveMode driveMode,
double strafe)
Allows the drivers to drive the robot with G1
left and right joysticks.
|
void |
init()
Initializes the robot
|
void |
intake(boolean showTelemetry,
boolean stallAutomation)
Runs intake processes depending on gamepad input
and adds data for intake telemetry
|
void |
loop()
Continuously checks gamepads for input while the OpMode is running
|
void |
moveArm(boolean showTelemetry)
Moves the joint of the arm depending on gampepad input
and adds data for arm telemetry
|
void |
moveGrabber(boolean showTelemetry)
Moves the grabber depending on gamepad input
and adds data for grabber telemetry
|
void |
shoot(boolean showTelemetry)
Runs shooter processes depending on gamepad input
and adds data for shooter telemetry
|
Robot robot
com.qualcomm.robotcore.util.ElapsedTime time
boolean stalled
public void init()
- Indexer will move into READY position upon init - Pre-condition: drive team has manually moved the arm into STOWED position
init
in class com.qualcomm.robotcore.eventloop.opmode.OpMode
public void loop()
loop
in class com.qualcomm.robotcore.eventloop.opmode.OpMode
public void drive(DriveMode driveMode, double strafe)
G1 left stick - vertical/horizontal motion of robot G1 right stick - rotation of robot
driveMode
- the drive mode (normal, squared, cubed)strafe
- an experimentally determined constant that is multiplied
by the x value to counteract imperfect strafingpublic void intake(boolean showTelemetry, boolean stallAutomation)
G2 left bumper intakes rings G2 right bumper outtakes rings Otherwise, intake is stopped
showTelemetry
- whether to display intake telemetry infostallAutomation
- whether you want to enable stall automationpublic void shoot(boolean showTelemetry)
G2 A button pressed speeds up the flywheel to target shooting velocity. G2 B button pressed stops flywheel. G2 right trigger moves the indexer to actually "shoot" the ring.
showTelemetry
- whether to display shooter telemetry infopublic void moveArm(boolean showTelemetry)
G2 dpad up puts arm in stowed position G2 dpad down puts arm in down position G2 dpad left puts arm in carry position
showTelemetry
- whether to display shooter telemetry infopublic void moveGrabber(boolean showTelemetry)
G2 X button closes the grabber G2 Y button opens the grabber
showTelemetry
- whether to display shooter telemetry info