From: Meryem Esa Date: Sat, 14 Jan 2017 21:49:51 +0000 (-0800) Subject: testing TimeDrive X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=b081e34b72803bc0b4ec11f0ab7676596da59fde testing TimeDrive --- diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index b8016bd..9147e11 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -8,8 +8,8 @@ package org.usfirst.frc.team3501.robot; public class Constants { public static class OI { - public final static int LEFT_STICK_PORT = 0; - public final static int RIGHT_STICK_PORT = 1; + public final static int LEFT_STICK_PORT = 1; + public final static int RIGHT_STICK_PORT = 0; } public static class DriveTrain { diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index baf2e66..8e98834 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -1,5 +1,6 @@ package org.usfirst.frc.team3501.robot; +import org.usfirst.frc.team3501.robot.commands.driving.TimeDrive; import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; import edu.wpi.first.wpilibj.IterativeRobot; @@ -25,6 +26,7 @@ public class Robot extends IterativeRobot { @Override public void autonomousInit() { + Scheduler.getInstance().add(new TimeDrive(1.5, 0.4)); } @Override diff --git a/src/org/usfirst/frc/team3501/robot/commands/driving/TimeDrive.java b/src/org/usfirst/frc/team3501/robot/commands/driving/TimeDrive.java index 6280541..d0104a8 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/driving/TimeDrive.java +++ b/src/org/usfirst/frc/team3501/robot/commands/driving/TimeDrive.java @@ -5,13 +5,15 @@ import org.usfirst.frc.team3501.robot.Robot; import edu.wpi.first.wpilibj.Timer; import edu.wpi.first.wpilibj.command.Command; -/** +/*** * This commands make the robot drive for a specified time with the motors set * at a specified value between 1 and -1 * * parameters: * time: how long the robot should drive for - in seconds * motorVal: the motor input to set the motors to + * + * */ public class TimeDrive extends Command { Timer timer; @@ -28,11 +30,12 @@ public class TimeDrive extends Command { @Override protected void initialize() { timer.start(); - Robot.getDriveTrain().setMotorValues(motorVal, motorVal); } @Override protected void execute() { + Robot.getDriveTrain().setMotorValues(motorVal, motorVal); + } @Override diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java index 1e9bb33..a5987e1 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -47,12 +47,12 @@ public class DriveTrain extends Subsystem { frontLeft.set(left); rearLeft.set(left); - frontRight.set(right); - rearRight.set(right); + frontRight.set(-right); + rearRight.set(-right); } public void joystickDrive(final double thrust, final double twist) { - robotDrive.arcadeDrive(thrust, twist); + robotDrive.arcadeDrive(thrust, twist, true); } public void stop() {