-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Climber API for moving climber between setpoint positions
- Loading branch information
Showing
4 changed files
with
302 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/frc/robot/commands/climber/ClimberSetpointCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package frc.robot.commands.climber; | ||
|
||
import edu.wpi.first.wpilibj2.command.CommandBase; | ||
import frc.robot.Constants.ClimberSetpoint; | ||
import frc.robot.subsystems.Climber; | ||
|
||
public class ClimberSetpointCommand extends CommandBase { | ||
|
||
private final ClimberSetpoint setpoint; | ||
private final Climber climber; | ||
|
||
public ClimberSetpointCommand(ClimberSetpoint setpoint, Climber climber) { | ||
this.setpoint = setpoint; | ||
this.climber = climber; | ||
|
||
addRequirements(climber); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
climber.moveToSetpoint(setpoint); | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
climber.stop(); | ||
} | ||
|
||
} |
Oops, something went wrong.