forked from NRG948/NRGRobot2024
-
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.
Reformat files according to Google Java Formatter
- Loading branch information
Showing
2 changed files
with
37 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,51 @@ | ||
// 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. | ||
|
||
/* | ||
* Copyright (c) 2024 Newport Robotics Group. All Rights Reserved. | ||
* | ||
* Open Source Software; you can modify and/or share it under the terms of | ||
* the license file in the root directory of this project. | ||
*/ | ||
package frc.robot.commands; | ||
|
||
import java.util.Optional; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import edu.wpi.first.wpilibj2.command.Commands; | ||
import frc.robot.subsystems.ClimberSubsystem; | ||
import frc.robot.subsystems.Subsystems; | ||
import java.util.Optional; | ||
|
||
/** Commands to wind and undwind the climber subsystem on the chain. */ | ||
public class ClimberCommands { | ||
|
||
/** | ||
* Returns a command to manually wind the climber. | ||
* @param subsystems The subsystems container. | ||
* @return A command to manually wind the climber. | ||
*/ | ||
public static Command manualClimbChain(Subsystems subsystems) { | ||
Optional<ClimberSubsystem> climber = subsystems.climber; | ||
|
||
if (climber.isEmpty()) { | ||
return Commands.none(); | ||
} | ||
|
||
return Commands.run(() -> climber.get().wind(), climber.get()).finallyDo(() -> climber.get().stopMotors()); | ||
/** | ||
* Returns a command to manually wind the climber. | ||
* | ||
* @param subsystems The subsystems container. | ||
* @return A command to manually wind the climber. | ||
*/ | ||
public static Command manualClimbChain(Subsystems subsystems) { | ||
Optional<ClimberSubsystem> climber = subsystems.climber; | ||
|
||
if (climber.isEmpty()) { | ||
return Commands.none(); | ||
} | ||
|
||
/** | ||
* Returns a command to manually unwind the climber. | ||
* @param subsystems The subsystems container. | ||
* @return A command to manually unwind the climber. | ||
*/ | ||
public static Command manualClimbDownChain(Subsystems subsystems) { | ||
Optional<ClimberSubsystem> climber = subsystems.climber; | ||
|
||
if (climber.isEmpty()) { | ||
return Commands.none(); | ||
} | ||
|
||
return Commands.run(() -> climber.get().unwind(), climber.get()).finallyDo(() -> climber.get().stopMotors()); | ||
return Commands.run(() -> climber.get().wind(), climber.get()) | ||
.finallyDo(() -> climber.get().stopMotors()); | ||
} | ||
|
||
/** | ||
* Returns a command to manually unwind the climber. | ||
* | ||
* @param subsystems The subsystems container. | ||
* @return A command to manually unwind the climber. | ||
*/ | ||
public static Command manualClimbDownChain(Subsystems subsystems) { | ||
Optional<ClimberSubsystem> climber = subsystems.climber; | ||
|
||
if (climber.isEmpty()) { | ||
return Commands.none(); | ||
} | ||
|
||
return Commands.run(() -> climber.get().unwind(), climber.get()) | ||
.finallyDo(() -> climber.get().stopMotors()); | ||
} | ||
} |