testing TimeDrive
authorMeryem Esa <meresa14@gmail.com>
Sat, 14 Jan 2017 21:49:51 +0000 (13:49 -0800)
committerCindy Zhang <cindyzyx9@gmail.com>
Sat, 14 Jan 2017 23:09:32 +0000 (15:09 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/Robot.java
src/org/usfirst/frc/team3501/robot/commands/driving/TimeDrive.java
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java

index b8016bd62da35c46a902e738404cb70da0231c2f..9147e11c4618504f08f4dfd50d23e95deff83e76 100644 (file)
@@ -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 {
index baf2e66cbf963a36be871d513d1fc154af7f7d65..8e98834a47f60a7d2e50b9f4b12d9a31b934afea 100644 (file)
@@ -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
index 62805410ab37f7fe205ddd1507c25646dc69f47e..d0104a84415055d5eca765434e4feabf438e5355 100755 (executable)
@@ -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
index 1e9bb33e7428677f1a83e9374e1052229206afe5..a5987e1fa4c914432e05c2065a9432c49e5cc9bb 100644 (file)
@@ -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() {