Skip to content

Comments

RewriteClimber#29

Merged
Tortuga-AM merged 7 commits intomainfrom
ClimberRewrite
Jun 1, 2025
Merged

RewriteClimber#29
Tortuga-AM merged 7 commits intomainfrom
ClimberRewrite

Conversation

@Yuriana101
Copy link
Contributor

No description provided.

@Tortuga-AM Tortuga-AM requested a review from Copilot May 31, 2025 16:44
Copy link
Contributor

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 refactors the Climber subsystem to use state‐driven speed control while introducing a singleton for the Climber class and finalizing some constant refactoring.

  • Exposes ClimberStates.getSpeed() as public for external access.
  • Adds a speedSetpoint in ClimberIOReal and ClimberIO, along with a state field.
  • Introduces a singleton pattern in Climber.java and replaces a TODO comment in the constants with a new static class.

Reviewed Changes

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

Show a summary per file
File Description
ClimberStates.java Changed getSpeed() from protected to public to support state‐driven usage.
ClimberIOReal.java Added speedSetpoint field and updated inputs with minimal style adjustments.
ClimberIO.java Added speedSetpoint and state fields in ClimberIOInputs.
ClimberConstants.java Eliminated a TODO by introducing a new static class Real.
Climber.java Introduced a singleton implementation and updated state handling in runState.
Comments suppressed due to low confidence (1)

src/main/java/frc/robot/Subsystems/Climber/ClimberStates.java:25

  • Changing getSpeed's access modifier from protected to public increases its visibility. Please verify that exposing this method aligns with your intended API design without compromising encapsulation.
public double getSpeed() {

@Tortuga-AM
Copy link
Contributor

You can fix these or lmk and I'll do it

@Tortuga-AM Tortuga-AM requested a review from Copilot June 1, 2025 00:07
Copy link
Contributor

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 refactors the Climber subsystem to drive motor output purely from its state machine, adds setpoint monitoring, and implements a singleton pattern for Climber.

  • Expose getSpeed() in ClimberStates for external callers
  • Track and log speedSetpoint in ClimberIO and ClimberIOReal
  • Introduce a singleton (getInstance()) in Climber and simplify runState() to use state speeds
  • Clean up stray TODO comment in ClimberConstants

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/frc/robot/Subsystems/Climber/ClimberStates.java Changed getSpeed() from protected to public
src/main/java/frc/robot/Subsystems/Climber/ClimberIOReal.java Added speedSetpoint field, set it in setSpeed(), and propagate in updateInputs()
src/main/java/frc/robot/Subsystems/Climber/ClimberIO.java Added speedSetpoint to ClimberIOInputs
src/main/java/frc/robot/Subsystems/Climber/ClimberConstants.java Removed redundant // TODO comment
src/main/java/frc/robot/Subsystems/Climber/Climber.java Added singleton instance and getInstance(), replaced manual trigger logic with state-driven speed
Comments suppressed due to low confidence (2)

src/main/java/frc/robot/Subsystems/Climber/Climber.java:11

  • [nitpick] The singleton instance field is declared public; consider making it private static and only exposing it via getInstance() to encapsulate the pattern.
public static Climber instance;

src/main/java/frc/robot/Subsystems/Climber/ClimberIOReal.java:27

  • Add or update unit tests to verify that speedSetpoint is correctly stored in ClimberIOReal and propagated through updateInputs.
this.speedSetpoint = speed;

Copy link
Contributor

@Tortuga-AM Tortuga-AM left a comment

Choose a reason for hiding this comment

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

your choice merge or fix.

@Tortuga-AM Tortuga-AM merged commit c05fb6f into main Jun 1, 2025
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.

2 participants