-
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.
- Loading branch information
1 parent
9bd968d
commit 56dd410
Showing
2 changed files
with
49 additions
and
1 deletion.
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
46 changes: 46 additions & 0 deletions
46
src/main/java/frc/robot/elevator/commands/AmpScoreKill.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,46 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
package frc.robot.elevator.commands; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.constants.ElevatorConstants; | ||
import frc.robot.elevator.Elevator; | ||
|
||
public class AmpScoreKill extends Command { | ||
private final Elevator elevator; | ||
|
||
public AmpScoreKill(Elevator elevator) { | ||
this.elevator = elevator; | ||
addRequirements(elevator); | ||
|
||
} | ||
|
||
@Override | ||
|
||
public void initialize() { | ||
elevator.run(ElevatorConstants.MOTOR_SLOWFALL_SPEED); | ||
} | ||
|
||
|
||
@Override | ||
public void execute() {} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
elevator.run(0); | ||
} | ||
|
||
|
||
@Override | ||
public boolean isFinished() { | ||
double steps = elevator.getEncoderPosition(); | ||
if (steps < ElevatorConstants.MOTOR_MIN_STEPS) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
|
||
} | ||
} |