8af1bcbfc3f9e21d9756dc808916539473aedcdf
1 package org
.usfirst
.frc
.team3501
.robot
.commands
.driving
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import edu
.wpi
.first
.wpilibj
.command
.Command
;
8 * This command makes the robot drive a specified distance using encoders on the
9 * robot and using a feedback loop
12 * distance the robot will move in inches
13 * motorVal: the motor input to set the motors to
15 public class DriveDistance
extends Command
{
17 public DriveDistance(double distance
, double motorVal
) {
18 requires(Robot
.getDriveTrain());
21 // Called just before this Command runs the first time
23 protected void initialize() {
26 // Called repeatedly when this Command is scheduled to run
28 protected void execute() {
31 // Make this return true when this Command no longer needs to run execute()
33 protected boolean isFinished() {
37 // Called once after isFinished returns true
39 protected void end() {
42 // Called when another command which requires one or more of the same
43 // subsystems is scheduled to run
45 protected void interrupted() {