Guest User

Untitled

a guest
Mar 5th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.33 KB | None | 0 0
  1. package us.mn.k12.fairmont.robotics.commands;
  2.  
  3. public class DriveToDistance extends CommandBase {
  4.    
  5.     /**
  6.      * Require the drive train and store the desired setpoint.
  7.      *
  8.      * @param setpoint The desired setpoint for the drive train.
  9.      */
  10.     public DriveToDistance() {
  11.         requires(drivetrain);
  12.     }
  13.  
  14.     // Called just before this Command runs the first time
  15.     /**
  16.      * Set the setpoint to the stored value and enable PID on the drivetrain.
  17.      */
  18.     protected void initialize() {
  19. //       drivetrain.autoTimeDrive(10, true);
  20.         System.out.println(this);
  21.     }
  22.  
  23.     // Called repeatedly when this Command is scheduled to run
  24.     protected void execute() {
  25.     }
  26.  
  27.     // Make this return true when this Command no longer needs to run execute()
  28.     /**
  29.      * @return true when it's close enough to the setpoint
  30.      */
  31.     protected boolean isFinished() {
  32.         return false;
  33.     }
  34.  
  35.     // Called once after isFinished returns true
  36.     /**
  37.      * When this command ends, disable the drivetrain's PID
  38.      */
  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.     /**
  45.      * When this command exits, disable the drivetrain's PID
  46.      */
  47.     protected void interrupted() {
  48.  
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment