1 package org
.usfirst
.frc
.team3501
.robot
.commands
.driving
;
3 import org
.usfirst
.frc
.team3501
.robot
.OI
;
4 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
6 import edu
.wpi
.first
.wpilibj
.Joystick
.AxisType
;
7 import edu
.wpi
.first
.wpilibj
.command
.Command
;
10 * This command will run throughout teleop and listens for joystick inputs to
11 * drive the driveTrain. This never finishes until teleop ends. - works in
12 * conjunction with OI.java
14 public class JoystickDrive
extends Command
{
16 public JoystickDrive() {
17 requires(Robot
.getDriveTrain());
21 protected void initialize() {
25 protected void execute() {
26 final double thrust
= OI
.xboxController
.getY();
27 final double twist
= OI
.xboxController
.getAxis(AxisType
.kZ
);
29 Robot
.getDriveTrain().joystickDrive(-thrust
, -twist
);
32 * double left = OI.leftJoystick.getY(); double right =
33 * OI.rightJoystick.getY(); Robot.getDriveTrain().tankDrive(-left, -right);
38 protected boolean isFinished() {
43 protected void end() {
44 Robot
.getDriveTrain().stop();
48 protected void interrupted() {