Class AutoBalanceCommand
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.robot.commands.swervedrive.auto.AutoBalanceCommand
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
public class AutoBalanceCommand
extends edu.wpi.first.wpilibj2.command.Command
Auto Balance command using a simple PID controller. Created by Team 3512
...
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior -
Field Summary
Fields inherited from class edu.wpi.first.wpilibj2.command.Command
m_requirements -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineWith, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, runsWhenDisabled, schedule, setName, setSubsystem, unless, until, withInterruptBehavior, withName, withTimeout
-
Constructor Details
-
AutoBalanceCommand
-
-
Method Details
-
initialize
public void initialize()The initial subroutine of a command. Called once when the command is initially scheduled.- Overrides:
initializein classedu.wpi.first.wpilibj2.command.Command
-
execute
public void execute()The main body of a command. Called repeatedly while the command is scheduled. (That is, it is called repeatedly untilisFinished()) returns true.)- Overrides:
executein classedu.wpi.first.wpilibj2.command.Command
-
isFinished
public boolean isFinished()Returns whether this command has finished. Once a command finishes -- indicated by this method returning true -- the scheduler will call its
end(boolean)method.Returning false will result in the command never ending automatically. It may still be cancelled manually or interrupted by another command. Hard coding this command to always return true will result in the command executing once and finishing immediately. It is recommended to use *
InstantCommandfor such an operation.- Overrides:
isFinishedin classedu.wpi.first.wpilibj2.command.Command- Returns:
- whether this command has finished.
-
end
public void end(boolean interrupted) The action to take when the command ends. Called when either the command finishes normally -- that is it is called whenisFinished()returns true -- or when it is interrupted/canceled. This is where you may want to wrap up loose ends, like shutting off a motor that was being used in the command.- Overrides:
endin classedu.wpi.first.wpilibj2.command.Command- Parameters:
interrupted- whether the command was interrupted/canceled
-