-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Spectrum3847/Dripping-Springs
Dripping springs Updates, merge into main
- Loading branch information
Showing
16 changed files
with
141 additions
and
61 deletions.
There are no files selected for viewing
Binary file not shown.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,67 @@ | ||
package frc.robot.commands; | ||
|
||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import edu.wpi.first.wpilibj2.command.RunCommand; | ||
import edu.wpi.first.wpilibj2.command.WaitCommand; | ||
import frc.robot.Robot; | ||
import frc.robot.constants.ClimberConstants; | ||
|
||
public class ClimberCommands { | ||
/* Climber Sequence | ||
* 1. fullUp | ||
* 2. climb | ||
* 3. nextRungExtend | ||
* 4. nextRungUp | ||
* Repeat 2-4. | ||
*/ | ||
/* | ||
* Climber Sequence | ||
* 1. fullUp | ||
* 2. climb | ||
* 3. nextRungExtend | ||
* 4. nextRungUp | ||
* Repeat 2-4. | ||
*/ | ||
|
||
//Put the climber fully up, used to grab the mid bar | ||
public static Command fullUp(){ | ||
return tiltUp().alongWith(extendFull()); | ||
// Put the climber fully up, used to grab the mid bar | ||
public static Command fullUp() { | ||
return extendFull().alongWith(new WaitCommand(0.5).andThen(tiltUp())); | ||
} | ||
|
||
//Put the climber partially out and tilted up, used to grab the next rung | ||
public static Command nextRungUp(){ | ||
// Put the climber partially out and tilted up, used to grab the next rung | ||
public static Command nextRungUp() { | ||
return tiltUp().alongWith(extendNextRung()); | ||
} | ||
|
||
//pull the climber down, used to climb to mid bar, and from rung to rung | ||
public static Command climb(){ | ||
return tiltDown().alongWith(pull()); | ||
public static Command nextRungDown(){ | ||
return extendNextRung().alongWith(releaseRung()); | ||
} | ||
|
||
// pull the climber down, used to climb to mid bar, and from rung to rung | ||
public static Command climb() { | ||
return pull().alongWith(new WaitCommand(0.1).andThen(tiltDown())); | ||
} | ||
|
||
// release rung | ||
public static Command releaseRung() { | ||
return tiltUp().withTimeout(0.2).andThen(tiltDown()); | ||
} | ||
|
||
public static Command extendFull(){ | ||
public static Command extendFull() { | ||
return toPosition(ClimberConstants.fullExtend); | ||
} | ||
|
||
//Used to extend before tilting up to grab the next rung | ||
public static Command extendNextRung(){ | ||
// Used to extend before tilting up to grab the next rung | ||
public static Command extendNextRung() { | ||
return toPosition(ClimberConstants.nextRungExtend); | ||
} | ||
|
||
public static Command pull(){ | ||
public static Command pull() { | ||
return toPosition(ClimberConstants.fullRetract); | ||
} | ||
|
||
public static Command toPosition(double position){ | ||
return new RunCommand(()-> Robot.climber.setMMPosition(position), Robot.climber); | ||
public static Command toPosition(double position) { | ||
return new RunCommand(() -> Robot.climber.setMMPosition(position), Robot.climber); | ||
} | ||
|
||
public static Command tiltUp(){ | ||
return new RunCommand(()-> Robot.climber.tiltUp(), Robot.climber.pneumatic); | ||
public static Command tiltUp() { | ||
return new RunCommand(() -> Robot.climber.tiltUp(), Robot.climber.pneumatic); | ||
} | ||
|
||
public static Command tiltDown(){ | ||
return new RunCommand(()-> Robot.climber.tiltDown(), Robot.climber.pneumatic); | ||
public static Command tiltDown() { | ||
return new RunCommand(() -> Robot.climber.tiltDown(), Robot.climber.pneumatic); | ||
} | ||
} |
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
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
Oops, something went wrong.