From: Cindy Zhang Date: Thu, 12 Jan 2017 05:17:05 +0000 (-0800) Subject: change variables 'left' and 'right' that store joystick values to 'thrust' and 'twist' X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=5483fde92e93a81b148371eb4eb9f69c44a7d591 change variables 'left' and 'right' that store joystick values to 'thrust' and 'twist' --- diff --git a/src/org/usfirst/frc/team3501/robot/commands/driving/JoystickDrive.java b/src/org/usfirst/frc/team3501/robot/commands/driving/JoystickDrive.java index cea1b6b..d12614f 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/driving/JoystickDrive.java +++ b/src/org/usfirst/frc/team3501/robot/commands/driving/JoystickDrive.java @@ -20,10 +20,10 @@ public class JoystickDrive extends Command { @Override protected void execute() { - final double left = OI.leftJoystick.getY(); - final double right = OI.rightJoystick.getY(); + final double thrust = OI.rightJoystick.getY(); + final double twist = OI.rightJoystick.getTwist(); - Robot.getDriveTrain().joystickDrive(left, right); + Robot.getDriveTrain().joystickDrive(-thrust, -twist); } @Override diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java index 5389b23..4bbda0f 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -1,6 +1,7 @@ package org.usfirst.frc.team3501.robot.subsystems; import org.usfirst.frc.team3501.robot.Constants; +import org.usfirst.frc.team3501.robot.commands.driving.JoystickDrive; import com.ctre.CANTalon; @@ -46,8 +47,8 @@ public class DriveTrain extends Subsystem { robotDrive.tankDrive(left, right); } - public void joystickDrive(final double left, final double right) { - robotDrive.tankDrive(left, right); + public void joystickDrive(final double thrust, final double twist) { + robotDrive.arcadeDrive(thrust, twist); } public void stop() { @@ -119,6 +120,7 @@ public class DriveTrain extends Subsystem { @Override protected void initDefaultCommand() { + setDefaultCommand(new JoystickDrive()); } }