make so does not crash
[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
10 requires(drivetrain);
11 }
12
13 protected void execute() {
14 double forward = oi.getForwardR();
15 double twist = oi.getTwistR();
16
17 // option to lock twist for alignment
18 if (oi.getRightPressed(3, 4, 5, 6))
19 twist = 0;
20
21 drivetrain.drive(forward, twist);
22 }
23
24 protected boolean isFinished() {
25 return false;
26 }
27 }