From 95adbe68c052382caa3e8a6b78b4610efbe22626 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 20 Nov 2015 10:42:23 -0800 Subject: [PATCH] add DriveForTime command --- .../commands/{DriveFor.java => DriveForTime.java} | 4 ++-- .../frc3501/RiceCatRobot/commands/DriveForTimesSequence.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/org/usfirst/frc3501/RiceCatRobot/commands/{DriveFor.java => DriveForTime.java} (91%) diff --git a/src/org/usfirst/frc3501/RiceCatRobot/commands/DriveFor.java b/src/org/usfirst/frc3501/RiceCatRobot/commands/DriveForTime.java similarity index 91% rename from src/org/usfirst/frc3501/RiceCatRobot/commands/DriveFor.java rename to src/org/usfirst/frc3501/RiceCatRobot/commands/DriveForTime.java index b614a07..9f7d91b 100644 --- a/src/org/usfirst/frc3501/RiceCatRobot/commands/DriveFor.java +++ b/src/org/usfirst/frc3501/RiceCatRobot/commands/DriveForTime.java @@ -11,13 +11,13 @@ import edu.wpi.first.wpilibj.command.Command; * This command takes a time in seconds which is how long it should run * */ -public class DriveFor extends Command { +public class DriveForTime extends Command { private double seconds; private double speed; private Timer timer; private Direction direction; - public DriveFor(double seconds, double speed, Direction direction) { + public DriveForTime(double seconds, double speed, Direction direction) { // limit speed to the range [0, MOTOR_MAX_VAL] this.speed = Math.max(speed, -speed); this.speed = Math.min(speed, DriveTrain.MOTOR_MAX_VAL); diff --git a/src/org/usfirst/frc3501/RiceCatRobot/commands/DriveForTimesSequence.java b/src/org/usfirst/frc3501/RiceCatRobot/commands/DriveForTimesSequence.java index d5d4b44..8b1321d 100644 --- a/src/org/usfirst/frc3501/RiceCatRobot/commands/DriveForTimesSequence.java +++ b/src/org/usfirst/frc3501/RiceCatRobot/commands/DriveForTimesSequence.java @@ -31,7 +31,7 @@ public class DriveForTimesSequence extends CommandGroup { double time = timings[i][0]; double speed = timings[i][1]; - addSequential(new DriveFor(time, speed, direction)); + addSequential(new DriveForTime(time, speed, direction)); } } } \ No newline at end of file -- 2.30.2