Commit | Line | Data |
---|---|---|
33141cdd KZ |
1 | package org.usfirst.frc.team3501.robot.commands.driving; |
2 | ||
3 | import org.usfirst.frc.team3501.robot.Robot; | |
4 | ||
5 | import edu.wpi.first.wpilibj.command.Command; | |
6 | ||
7 | /** | |
1c94f230 | 8 | * Runs throughout teleop and listens for joystick inputs and drives the |
571a0e2a | 9 | * driveTrain Never finishes until teleop ends |
33141cdd KZ |
10 | */ |
11 | public class JoystickDrive extends Command { | |
12 | ||
13 | public JoystickDrive() { | |
14 | requires(Robot.driveTrain); | |
15 | } | |
16 | ||
17 | @Override | |
18 | protected void initialize() { | |
19 | } | |
20 | ||
21 | @Override | |
22 | protected void execute() { | |
67af84eb KZ |
23 | double thrust = Robot.oi.leftJoystick.getY(); |
24 | double twist = Robot.oi.leftJoystick.getTwist(); | |
25 | ||
4da6de9a | 26 | Robot.driveTrain.joystickDrive(-thrust, -twist); |
33141cdd KZ |
27 | } |
28 | ||
29 | @Override | |
30 | protected boolean isFinished() { | |
31 | return false; | |
32 | } | |
33 | ||
34 | @Override | |
35 | protected void end() { | |
36 | Robot.driveTrain.stop(); | |
37 | } | |
38 | ||
39 | @Override | |
40 | protected void interrupted() { | |
33141cdd KZ |
41 | } |
42 | } |