| 1 | package org.usfirst.frc.team3501.robot.commands.auton; |
| 2 | |
| 3 | import org.usfirst.frc.team3501.robot.Constants; |
| 4 | import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance; |
| 5 | import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime; |
| 6 | |
| 7 | import edu.wpi.first.wpilibj.command.CommandGroup; |
| 8 | |
| 9 | /*** |
| 10 | * This command will drive the robot through the moat. |
| 11 | * |
| 12 | * The code drives the robot for a specific time at a specific speed up the ramp |
| 13 | * to the defense then drive over the defense at a different speed and time. |
| 14 | * |
| 15 | * dependency on subsystem: drivetrain |
| 16 | * |
| 17 | * dependency on other commands: DriveForTime |
| 18 | * |
| 19 | * pre-condition: robot is flush against the ramp of the outerworks in front of |
| 20 | * the moat |
| 21 | * |
| 22 | * post-condition: the robot has passed the moat and is in the next zone |
| 23 | * |
| 24 | * @author Meryem and Avi |
| 25 | * |
| 26 | */ |
| 27 | |
| 28 | public class PassMoat extends CommandGroup { |
| 29 | |
| 30 | public PassMoat() { |
| 31 | if (Constants.Auton.isUsingTime) { |
| 32 | addSequential(new DriveForTime(Constants.Auton.passMoatTime, |
| 33 | Constants.Auton.passMoatSpeed)); |
| 34 | } |
| 35 | else { |
| 36 | addSequential(new DriveDistance(Constants.Auton.passMoatDistance, |
| 37 | Constants.DriveTrain.PASS_DEFENSE_TIMEOUT)); |
| 38 | } |
| 39 | |
| 40 | } |
| 41 | } |