Skip to content

Commit

Permalink
test command
Browse files Browse the repository at this point in the history
  • Loading branch information
antonio-dias-illumio committed Oct 7, 2019
1 parent 813adca commit a6a424e
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions MiniLib/src/frc/team670/robot/commands/drive/TimeDrive.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package frc.team670.robot.commands.drive;

import edu.wpi.first.wpilibj.command.Command;
import frc.team670.robot.Robot;
import frc.team670.robot.utils.Logger;

/**
Expand All @@ -22,35 +23,34 @@ public TimeDrive(double seconds, double speed) {
this.speed = speed;
this.seconds = seconds;
executeCounter = 0;
//requires(Robot.driveBase);
requires(Robot.driveBase);
}

// Called just before this Command runs the first time
@Override
protected void initialize() {
setTimeout(seconds);
//Logger.consoleLog("Speed: %s Seconds: %s", speed, seconds);
Logger.consoleLog("Speed: %s Seconds: %s", speed, seconds);
}

// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
//Robot.driveBase.tankDrive(speed, speed, false);
//Logger.consoleLog();

Robot.driveBase.tankDrive(speed, speed, false);
Logger.consoleLog();
}

// Make this return true when this Command no longer needs to run execute()
//@Override
// protected boolean isFinished() {
// //return isTimedOut();
// }
@Override
protected boolean isFinished() {
return isTimedOut();
}

// Called once after isFinished returns true
@Override
protected void end() {
// Robot.driveBase.stop();
//ogger.consoleLog("Speed: %s Seconds: %s", speed, seconds);
Robot.driveBase.stop();
Logger.consoleLog("Speed: %s Seconds: %s", speed, seconds);
}

// Called when another command which requires one or more of the same
Expand All @@ -59,10 +59,4 @@ protected void end() {
protected void interrupted() {
end();
}

@Override
protected boolean isFinished() {
// TODO Auto-generated method stub
return false;
}
}

0 comments on commit a6a424e

Please sign in to comment.