Commit | Line | Data |
---|---|---|
aa160dfd ME |
1 | package org.usfirst.frc.team3501.robot.commands.driving; |
2 | ||
3 | import org.usfirst.frc.team3501.robot.Robot; | |
4 | ||
5 | import edu.wpi.first.wpilibj.command.Command; | |
6 | ||
7 | /** | |
c0e9f911 ME |
8 | * This command makes the robot drive a specified distance using encoders on the |
9 | * robot and using a feedback loop | |
aa160dfd | 10 | * |
c0e9f911 ME |
11 | * parameters: |
12 | * distance the robot will move in inches | |
bed6dbe6 | 13 | * motorVal: the motor input to set the motors to |
aa160dfd ME |
14 | */ |
15 | public class DriveDistance extends Command { | |
16 | ||
bed6dbe6 | 17 | public DriveDistance(double distance, double motorVal) { |
d17d868d | 18 | requires(Robot.getDriveTrain()); |
19 | } | |
20 | ||
21 | // Called just before this Command runs the first time | |
22 | @Override | |
23 | protected void initialize() { | |
24 | } | |
25 | ||
26 | // Called repeatedly when this Command is scheduled to run | |
27 | @Override | |
28 | protected void execute() { | |
29 | } | |
30 | ||
31 | // Make this return true when this Command no longer needs to run execute() | |
32 | @Override | |
33 | protected boolean isFinished() { | |
34 | return false; | |
35 | } | |
36 | ||
37 | // Called once after isFinished returns true | |
38 | @Override | |
39 | protected void end() { | |
40 | } | |
41 | ||
42 | // Called when another command which requires one or more of the same | |
43 | // subsystems is scheduled to run | |
44 | @Override | |
45 | protected void interrupted() { | |
46 | } | |
aa160dfd | 47 | } |