5e935c97e0c99294eb9c32411107883a3a2fcc18
[3501/3501-spark-go] / src / org / usfirst / frc / team3501 / robot / commands / DriveWithJoysticks.java
1 package org.usfirst.frc.team3501.robot.commands;
2
3 import org.usfirst.frc.team3501.bases.Command;
4
5 public class DriveWithJoysticks extends Command {
6
7 public DriveWithJoysticks() {
8 super("DriveWithJoysticks");
9 requires(drivetrain);
10 }
11
12 protected void execute() {
13 double forward = oi.getForwardR();
14 double twist = oi.getTwistR();
15
16 // option to lock twist for alignment
17 if (oi.getRightPressed(3, 4, 5, 6))
18 twist = 0;
19
20 drivetrain.drive(forward, twist);
21 }
22
23 protected boolean isFinished() {
24 return false;
25 }
26 }