| 1 | package org.usfirst.frc.team3501.robot.autons; |
| 2 | |
| 3 | import org.usfirst.frc.team3501.robot.commands.Command; |
| 4 | |
| 5 | public class DriveOverStep extends Command { |
| 6 | |
| 7 | private double speed; |
| 8 | |
| 9 | public DriveOverStep() { |
| 10 | super("DriveOverStep"); |
| 11 | requires(drivetrain); |
| 12 | |
| 13 | setTimeout(autonData.getTime("drive_over_step")); |
| 14 | speed = autonData.getSpeed("drive_over_step"); |
| 15 | } |
| 16 | |
| 17 | // TODO: this is an ugly "solution" |
| 18 | public DriveOverStep(int coef) { |
| 19 | this(); |
| 20 | this.speed *= coef; |
| 21 | } |
| 22 | |
| 23 | protected void execute() { |
| 24 | drivetrain.goForward(speed); |
| 25 | } |
| 26 | |
| 27 | protected boolean isFinished() { |
| 28 | return isTimedOut(); |
| 29 | } |
| 30 | |
| 31 | protected void end() { |
| 32 | drivetrain.stop(); |
| 33 | } |
| 34 | } |