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 | |
aa160dfd ME |
13 | */ |
14 | public class DriveDistance extends Command { | |
15 | ||
c0e9f911 | 16 | public DriveDistance(double distance) { |
d17d868d | 17 | requires(Robot.getDriveTrain()); |
18 | } | |
19 | ||
20 | // Called just before this Command runs the first time | |
21 | @Override | |
22 | protected void initialize() { | |
23 | } | |
24 | ||
25 | // Called repeatedly when this Command is scheduled to run | |
26 | @Override | |
27 | protected void execute() { | |
28 | } | |
29 | ||
30 | // Make this return true when this Command no longer needs to run execute() | |
31 | @Override | |
32 | protected boolean isFinished() { | |
33 | return false; | |
34 | } | |
35 | ||
36 | // Called once after isFinished returns true | |
37 | @Override | |
38 | protected void end() { | |
39 | } | |
40 | ||
41 | // Called when another command which requires one or more of the same | |
42 | // subsystems is scheduled to run | |
43 | @Override | |
44 | protected void interrupted() { | |
45 | } | |
aa160dfd | 46 | } |