@@ -44,16 +44,21 @@ public static Command resetElevatorPositionCommand() {
4444 return new ParallelCommandGroup (
4545 new ExecuteEndCommand (
4646 () -> RobotContainer .ARM_ELEVATOR .setTargetArmState (ArmElevatorConstants .ArmElevatorState .ZERO_ELEVATOR , false ),
47- () -> {}
47+ () -> {
48+ }
4849 ).until (() -> RobotContainer .ARM_ELEVATOR .atState (ArmElevatorConstants .ArmElevatorState .ZERO_ELEVATOR )),
4950 new ExecuteEndCommand (
5051 () -> RobotContainer .ARM_ELEVATOR .setElevatorVoltage (OperatorConstants .DRIVER_CONTROLLER .getRightY () * 2 ),
51- () -> {},
52+ () -> {
53+ },
5254 RobotContainer .ARM_ELEVATOR
5355 ),
5456 SwerveCommands .getOpenLoopFieldRelativeDriveCommand (() -> 0 , () -> 0 , () -> 0 ),
5557 EndEffectorCommands .getSetTargetStateCommand (EndEffectorConstants .EndEffectorState .EJECT )
56- ).finallyDo (() -> {RobotContainer .ARM_ELEVATOR .resetElevatorPosition (); RobotContainer .END_EFFECTOR .setTargetState (EndEffectorConstants .EndEffectorState .REST );});
58+ ).finallyDo (() -> {
59+ RobotContainer .ARM_ELEVATOR .resetElevatorPosition ();
60+ RobotContainer .END_EFFECTOR .setTargetState (EndEffectorConstants .EndEffectorState .REST );
61+ });
5762 }
5863
5964 public static Command getSetTargetStateCommand (ArmElevatorConstants .ArmElevatorState targetState ) {
@@ -77,6 +82,17 @@ public static Command getSetTargetStateCommand(Supplier<ArmElevatorConstants.Arm
7782 );
7883 }
7984
85+ public static Command getStayInPlaceCommand () {
86+ return new ExecuteEndCommand (
87+ () -> {
88+ RobotContainer .ARM_ELEVATOR .setTargetArmAngle (RobotContainer .ARM_ELEVATOR .getCurrentArmAngle (), true );
89+ RobotContainer .ARM_ELEVATOR .setTargetElevatorPositionMeters (RobotContainer .ARM_ELEVATOR .getCurrentElevatorPositionMeters (), true );
90+ },
91+ RobotContainer .ARM_ELEVATOR ::stop ,
92+ RobotContainer .ARM_ELEVATOR
93+ );
94+ }
95+
8096 public static Command getPrepareForStateCommand (Supplier <ArmElevatorConstants .ArmElevatorState > targetState ) {
8197 return getPrepareForStateCommand (targetState , () -> false );
8298 }
0 commit comments