Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package us.mn.k12.fairmont.robotics.commands;
- public class DriveToDistance extends CommandBase {
- /**
- * Require the drive train and store the desired setpoint.
- *
- * @param setpoint The desired setpoint for the drive train.
- */
- public DriveToDistance() {
- requires(drivetrain);
- }
- // Called just before this Command runs the first time
- /**
- * Set the setpoint to the stored value and enable PID on the drivetrain.
- */
- protected void initialize() {
- // drivetrain.autoTimeDrive(10, true);
- System.out.println(this);
- }
- // Called repeatedly when this Command is scheduled to run
- protected void execute() {
- }
- // Make this return true when this Command no longer needs to run execute()
- /**
- * @return true when it's close enough to the setpoint
- */
- protected boolean isFinished() {
- return false;
- }
- // Called once after isFinished returns true
- /**
- * When this command ends, disable the drivetrain's PID
- */
- protected void end() {
- }
- // Called when another command which requires one or more of the same
- // subsystems is scheduled to run
- /**
- * When this command exits, disable the drivetrain's PID
- */
- protected void interrupted() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment