Skip to content

(#136) Remove extension state machine#137

Open
aidnem wants to merge 1 commit intomainfrom
136-remove-extension-state-machine
Open

(#136) Remove extension state machine#137
aidnem wants to merge 1 commit intomainfrom
136-remove-extension-state-machine

Conversation

@aidnem
Copy link
Contributor

@aidnem aidnem commented Mar 20, 2026

No description provided.

@aidnem aidnem linked an issue Mar 20, 2026 that may be closed by this pull request
3 tasks
@aidnem aidnem requested a review from Copilot March 20, 2026 23:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the CoordinationLayer “extension state machine” approach and replaces it with a simpler intake deploy boolean + direct climber commands.

Changes:

  • Renames climber stow button handler from returning a boolean (stowPressed) to a void handler (handleStowPress).
  • Replaces CoordinationLayer’s extension coordination state machine with a deployIntake boolean and direct intake position commands in coordinateRobotActions.
  • Updates manual/auto climb and intake methods to no longer depend on the extension goal state machine.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/main/java/frc/robot/subsystems/climber/ClimberSubsystem.java Renames stow-press handler and changes return type/behavior contract.
src/main/java/frc/robot/CoordinationLayer.java Removes extension state machine logic; introduces boolean-driven intake deploy logic and updates climber/intake bindings accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 388 to 392
/**
* Deploys the intake mechanism and activates the intake rollers for autonomous operation. Sets
* the goal extension state to {@link ExtensionState#IntakeDeployed} and enables the intake
* rollers to begin collecting game pieces.
*/
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Javadoc still references setting a “goal extension state” to ExtensionState#IntakeDeployed, but the implementation now just sets deployIntake/runningIntakeRollers. Please update the comment to describe the current behavior (or reintroduce the goal-state concept if still intended).

Copilot uses AI. Check for mistakes.
Comment on lines 407 to 411
*
* <ul>
* <li>Sets the goal extension state to {@link ExtensionState#None}, retracting the intake.
* <li>Stops the intake rollers by setting {@code runningIntakeRollers} to {@code false}.
* </ul>
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In stowIntakeForAuto’s Javadoc, the “Effects” list still says it sets the goal extension state to ExtensionState#None, but that state machine has been removed. Update the documentation to reflect the new deployIntake = false behavior (and consider removing the stale ExtensionState references once docs are corrected).

Copilot uses AI. Check for mistakes.
Comment on lines +449 to 454
deployIntake = !deployIntake;
if (deployIntake) {
runningIntakeRollers = true;
} else {
runningIntakeRollers = false;
}
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toggleIntakeDeploy now toggles deployIntake unconditionally, so the intake can be commanded to deploy even while the climber is in Search/Hang (there’s no longer any interlock/sequence to retract the climber first). If the mechanisms are mutually exclusive, reintroduce a guard/sequence here (e.g., request climber stow and only deploy intake once stowed).

Copilot uses AI. Check for mistakes.
} else {
intake.ifPresent(IntakeSubsystem::setTargetPositionStowed);
}

Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coordinateRobotActions now only commands the intake position based on deployIntake and no longer issues any default command to keep the climber stowed. This changes prior behavior where the coordination layer continuously called ClimberSubsystem::stayStowed when not climbing; if the climber should retract by default (or when intake is deployed), add explicit coordination here to avoid leaving the climber extended indefinitely.

Suggested change
// Ensure climber is stowed while intake is deployed to avoid leaving it extended
if (deployIntake) {
climber.ifPresent(ClimberSubsystem::stayStowed);
}

Copilot uses AI. Check for mistakes.
Comment on lines 332 to +335
* @return {@code true} if the climber is going to stow, {@code false} if not (if it will go to
* search)
*/
public boolean stowPressed() {
public void handleStowPress() {
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Javadoc for handleStowPress still has an @return tag describing a boolean return value, but the method now returns void. Update the Javadoc to remove/adjust the @return section so it matches the signature (DocLint/Checkstyle can fail on this mismatch).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove extension state machine

2 participants