generated from StuyPulse/Phil
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added AmperWaitToHeight + cleaned command code
- Loading branch information
1 parent
8acedfb
commit 37975c0
Showing
8 changed files
with
31 additions
and
8 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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/stuypulse/robot/commands/amper/AmperScoreAmp.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
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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/stuypulse/robot/commands/amper/AmperWaitToHeight.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,22 @@ | ||
package com.stuypulse.robot.commands.amper; | ||
|
||
import com.stuypulse.robot.constants.Settings.Amper.Lift; | ||
import com.stuypulse.robot.subsystems.amper.Amper; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class AmperWaitToHeight extends Command { | ||
|
||
private final Amper amper; | ||
private final double height; | ||
|
||
public AmperWaitToHeight(double height) { | ||
amper = Amper.getInstance(); | ||
this.height = height; | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return Math.abs(amper.getLiftHeight() - height) < Lift.MAX_HEIGHT_ERROR; | ||
} | ||
} |
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