Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make arm match #50

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Make arm match
  • Loading branch information
JosephTLockwood authored Feb 3, 2025
commit a0a6776eeaea6e51718e60df8bef336657662cfb
22 changes: 11 additions & 11 deletions src/main/java/frc/robot/subsystems/arm/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,21 @@ private enum ArmMode {
/**
* Gets the current arm position mode.
*
* @return The current ArmPosition
* @return The current ArmMode
*/
public ArmMode getMode() {
return currentMode;
}

/**
* Sets a new arm position and schedules the corresponding command.
* Sets a new arm mode and schedules the corresponding command.
*
* @param position The desired ArmPosition
* @param mode The desired ArmMode
*/
private void setArmPosition(ArmMode position) {
if (currentMode != position) {
private void setArmMode(ArmMode mode) {
if (currentMode != mode) {
currentCommand.cancel();
currentMode = position;
currentMode = mode;
currentCommand.schedule();
}
}
Expand Down Expand Up @@ -181,14 +181,14 @@ private Angle targetAngle() {
}

/**
* Creates a command to set the arm to a specific position.
* Creates a command to set the arm to a specific mode.
*
* @param mode The desired arm position
* @return Command to set the position
* @param mode The desired arm mode
* @return Command to set the mode
*/
private Command setPositionCommand(ArmMode mode) {
return Commands.runOnce(() -> setArmPosition(mode))
.withName("SetArmPosition(" + mode.toString() + ")");
return Commands.runOnce(() -> setArmMode(mode))
.withName("SetArmMode(" + mode.toString() + ")");
}

/** Factory methods for common position commands */
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/flywheel/Flywheel.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private AngularVelocity targetSpeed() {
*/
private Command setVelocityCommand(FlywheelMode mode) {
return Commands.runOnce(() -> setFlywheelMode(mode))
.withName("SetFlywheelVelocity(" + mode.toString() + ")");
.withName("SetFlywheelMode(" + mode.toString() + ")");
}

/** Factory methods for common mode commands */
Expand Down