| 1 | package org.usfirst.frc.team3501.robot.commands.driving; |
| 2 | |
| 3 | import org.usfirst.frc.team3501.robot.Constants.Direction; |
| 4 | import org.usfirst.frc.team3501.robot.Robot; |
| 5 | |
| 6 | import edu.wpi.first.wpilibj.command.Command; |
| 7 | |
| 8 | /** |
| 9 | * This command turns the robot for a specified angle in specified direction - |
| 10 | * either left or right |
| 11 | * |
| 12 | * parameters: |
| 13 | * angle: the robot will turn - in degrees |
| 14 | * direction: the robot will turn - either right or left |
| 15 | * motorVal: the motor input to set the motors to |
| 16 | */ |
| 17 | public class TurnForAngle extends Command { |
| 18 | |
| 19 | public TurnForAngle(double angle, Direction direction, double motorVal) { |
| 20 | requires(Robot.getDriveTrain()); |
| 21 | } |
| 22 | |
| 23 | // Called just before this Command runs the first time |
| 24 | @Override |
| 25 | protected void initialize() { |
| 26 | } |
| 27 | |
| 28 | // Called repeatedly when this Command is scheduled to run |
| 29 | @Override |
| 30 | protected void execute() { |
| 31 | } |
| 32 | |
| 33 | // Make this return true when this Command no longer needs to run execute() |
| 34 | @Override |
| 35 | protected boolean isFinished() { |
| 36 | return false; |
| 37 | } |
| 38 | |
| 39 | // Called once after isFinished returns true |
| 40 | @Override |
| 41 | protected void end() { |
| 42 | } |
| 43 | |
| 44 | // Called when another command which requires one or more of the same |
| 45 | // subsystems is scheduled to run |
| 46 | @Override |
| 47 | protected void interrupted() { |
| 48 | } |
| 49 | } |