Skip to content

Climb Subsystem - #5

Closed
kyladev wants to merge 7 commits into
mainfrom
climb
Closed

kyladev wants to merge 7 commits into
mainfrom
climb

Conversation

@kyladev

@kyladev kyladev commented Sep 25, 2026

Copy link
Copy Markdown

No description provided.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add configurable TalonFX climb subsystem

✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Adds a climb subsystem scaffold with TalonFX position control and current limits.
• Registers climb initialization behind a subsystem enable flag.
• Leaves simulation behavior and target positions as future implementation placeholders.
Diagram

graph TD
  A["Robot startup"] --> B["Subsystems registry"] --> C{"Climb enabled?"}
  C -->|Yes| D["Climb subsystem"] --> E["TalonFX motor"]
  C -->|No| F["Disabled slot"]
Loading
High-Level Assessment

A dedicated command-based subsystem using the existing central feature-flag pattern is the simplest fit for the current architecture. An IO abstraction could improve hardware-independent testing later, but it is premature for this scaffold; first resolve the package, constructor, field, hardware constant, simulation type, and position-request compile blockers.

Files changed (2) +79 / -0

Enhancement (2) +79 / -0
Subsystems.javaRegister climb subsystem behind an enable flag +9/-0

Register climb subsystem behind an enable flag

• Adds a climb enable constant and conditionally constructs the new subsystem during subsystem initialization. The integration still requires a declared climb field and a static import or qualified reference for the enable constant.

src/main/java/frc/robot/Subsystems.java

ClimbSubsystem.javaIntroduce TalonFX-based climb subsystem scaffold +70/-0

Introduce TalonFX-based climb subsystem scaffold

• Adds climb motor initialization, neutral-mode and current-limit configuration, position control, and motor stopping. Target positions and simulation behavior remain placeholders, while several unresolved declarations currently prevent compilation.

src/main/java/frc/robot/subsystems/ClimbSubsystem.java

@qodo-code-review

qodo-code-review Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Simulation type blocks compilation ✓ Resolved 🐞 Bug ≡ Correctness
Description
The motorSim field uses FlywheelSim without importing or declaring that type. Java must resolve
field types even when the field is always assigned null, so both robot and simulation builds fail.
Code

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[20]

+  private final FlywheelSim motorSim;
Evidence
FlywheelSim appears only as the field type at line 20, while the imports at lines 3-10 contain no
declaration or import for it.

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[3-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The climb subsystem declares an unresolved simulation type, even though simulation behavior has not yet been implemented.

## Fix Focus Areas
- src/main/java/frc/robot/subsystems/ClimbSubsystem.java[20-29]

## Recommended Fix
Import the appropriate WPILib `FlywheelSim` class if simulation is being implemented now, or remove the unused field and assignments until that implementation is added.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. The registry has no climb field 🐞 Bug ≡ Correctness
Description
The Subsystems constructor assigns climbSubsystem, but the class never declares that field. Both
branches of the new enable check reference the missing symbol, preventing registry compilation.
Code

src/main/java/frc/robot/Subsystems.java[R49-53]

+    if (CLIMB_ENABLED) {
+      climbSubsystem = new ClimbSubsystem();
+      
+    } else {
+      climbSubsystem = null;
Evidence
The only subsystem fields declared at lines 21-22 are the drivebase and intake, while the new
constructor block assigns climbSubsystem at lines 50 and 53.

src/main/java/frc/robot/Subsystems.java[21-22]
src/main/java/frc/robot/Subsystems.java[49-53]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The subsystem registry assigns the climber without declaring a corresponding class field.

## Fix Focus Areas
- src/main/java/frc/robot/Subsystems.java[21-22]
- src/main/java/frc/robot/Subsystems.java[49-53]

## Recommended Fix
Add `public final ClimbSubsystem climbSubsystem` alongside the drivebase and intake fields so both constructor branches initialize a declared final field.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. The motor constant stops the build ✓ Resolved 🐞 Bug ≡ Correctness
Description
CLIMB_MOTOR_ID is declared without a Java type before its name. The parser rejects this class
member before the climb subsystem can be compiled.
Code

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[13]

+  public final CLIMB_MOTOR_ID = 0; //placeholder
Evidence
Unlike a valid constant declaration, line 13 places CLIMB_MOTOR_ID directly between the modifiers
and assignment with no type or variable identifier pair.

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[13-13]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new motor identifier declaration omits its Java type and therefore cannot be parsed.

## Fix Focus Areas
- src/main/java/frc/robot/subsystems/ClimbSubsystem.java[13-13]

## Recommended Fix
Declare the identifier with an explicit type, such as `private static final int`, or remove it if the canonical mapping will live in `Hardware`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View high (5)
4. The climb enable check does not compile ✓ Resolved 🐞 Bug ≡ Correctness
Description
The constructor references CLIMB_ENABLED as an unqualified name, but only the drivebase and intake
flags are statically imported. The new initialization branch therefore fails name resolution even
though the nested constant exists.
Code

src/main/java/frc/robot/Subsystems.java[49]

+    if (CLIMB_ENABLED) {
Evidence
Lines 3-4 statically import only DRIVEBASE_ENABLED and INTAKE_ENABLED; the nested climb constant
at line 18 is consequently not available as the bare name used at line 49.

src/main/java/frc/robot/Subsystems.java[3-4]
src/main/java/frc/robot/Subsystems.java[18-18]
src/main/java/frc/robot/Subsystems.java[49-49]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The climb enable flag is declared inside `SubsystemConstants` but referenced without qualification or a static import.

## Fix Focus Areas
- src/main/java/frc/robot/Subsystems.java[3-4]
- src/main/java/frc/robot/Subsystems.java[18-18]
- src/main/java/frc/robot/Subsystems.java[49-49]

## Recommended Fix
Add a static import for `Subsystems.SubsystemConstants.CLIMB_ENABLED`, following the existing drivebase and intake pattern, or qualify the reference explicitly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. The registry cannot find the climber ✓ Resolved 🐞 Bug ≡ Correctness
Description
ClimbSubsystem declares the frc.robot.subsystems.index package while Subsystems imports it
from frc.robot.subsystems. Compilation fails as soon as the registry tries to resolve the newly
imported class.
Code

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[1]

+package frc.robot.subsystems.index;
Evidence
The new class declares frc.robot.subsystems.index, but the registry imports
frc.robot.subsystems.ClimbSubsystem; those are different fully qualified class names.

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[1-1]
src/main/java/frc/robot/Subsystems.java[10-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The climb class package does not match the package imported by the subsystem registry, so Java cannot resolve the class.

## Fix Focus Areas
- src/main/java/frc/robot/subsystems/ClimbSubsystem.java[1-1]
- src/main/java/frc/robot/Subsystems.java[10-10]

## Recommended Fix
Declare `ClimbSubsystem` in `frc.robot.subsystems`, matching its directory and the existing registry import.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. The climb hardware mapping is missing ✓ Resolved 🐞 Bug ≡ Correctness
Description
The constructor reads Hardware.CLIMB_MOTOR_ID, but Hardware defines no member with that name.
Compilation fails when resolving the Talon constructor argument, and the climber therefore cannot be
registered.
Code

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[23]

+    climbMotor = new TalonFX(Hardware.CLIMB_MOTOR_ID);
Evidence
The new constructor references Hardware.CLIMB_MOTOR_ID, while the complete Hardware class
currently contains only PDH_ID and IntakeMotor.

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[22-24]
src/main/java/frc/robot/Hardware.java[7-12]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The climb motor references a hardware identifier that is absent from the central hardware map.

## Fix Focus Areas
- src/main/java/frc/robot/subsystems/ClimbSubsystem.java[23-23]
- src/main/java/frc/robot/Hardware.java[7-12]

## Recommended Fix
Add a uniquely assigned `CLIMB_MOTOR_ID` integer to `Hardware` and keep the constructor reference to that shared constant; do not reuse the intake motor's CAN identifier.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Position commands do not compile ✓ Resolved 🐞 Bug ≡ Correctness
Description
setPos calls request.withPosition(pos), but request is never declared in ClimbSubsystem. Any
build compiling this method fails before position control can be used.
Code

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[R52-54]

+  public void setPos(double pos) {
+    climbMotor.setControl(request.withPosition(pos));
+  }
Evidence
The method references request at line 53, but the class fields at lines 13-20 declare only the
motor identifier, motor, target positions, and simulation object.

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[13-20]
src/main/java/frc/robot/subsystems/ClimbSubsystem.java[52-54]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The position setter references a control request object that does not exist in the climb class.

## Fix Focus Areas
- src/main/java/frc/robot/subsystems/ClimbSubsystem.java[15-20]
- src/main/java/frc/robot/subsystems/ClimbSubsystem.java[52-54]

## Recommended Fix
Create a typed CTRE position-control request field initialized for the intended control mode, then call `withPosition` on that field from `setPos`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. The climb class has no constructor ✓ Resolved 🐞 Bug ≡ Correctness
Description
ClimbSubsystem defines public Climb() instead of a constructor whose name matches the class.
Java treats this as a method without a return type, so compiling the new source fails.
Code

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[R22-24]

+  public Climb() {
+    climbMotor = new TalonFX(Hardware.CLIMB_MOTOR_ID);
+    climbConfig();
Evidence
The enclosing class is named ClimbSubsystem at line 12, whereas its constructor-like declaration
is named Climb at line 22.

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[12-22]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The constructor name differs from its enclosing class name, making the declaration invalid Java.

## Fix Focus Areas
- src/main/java/frc/robot/subsystems/ClimbSubsystem.java[12-22]

## Recommended Fix
Rename `public Climb()` to `public ClimbSubsystem()` so registry construction invokes a valid constructor.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

9. Climber setup failures stay hidden ✓ Resolved 🐞 Bug ☼ Reliability
Description
climbConfig discards the StatusCode returned by cfg.apply, unlike the intake configuration
path that retries and reports failure. If CAN communication is unavailable during startup, the
climber continues with default or partial settings without alerting the drive team.
Code

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[49]

+    cfg.apply(talonFXConfiguration);
Evidence
The climb path invokes cfg.apply once and ignores its result, while the intake path initializes a
status, retries up to five times, and reports a persistent failure through DriverStation.

src/main/java/frc/robot/subsystems/ClimbSubsystem.java[32-49]
src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java[42-51]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The climb motor ignores configuration application failures, leaving the robot unaware that current limits or control gains were not installed.

## Fix Focus Areas
- src/main/java/frc/robot/subsystems/ClimbSubsystem.java[32-49]
- src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java[42-51]

## Recommended Fix
Capture the returned `StatusCode`, retry configuration a bounded number of times, and call `DriverStation.reportError` if all attempts fail, following the established intake subsystem pattern.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced: This introduces new runtime motor-control hardware logic and subsystem wiring with likely compile, safety, and behavior risks, warranting a complete review.

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/main/java/frc/robot/subsystems/ClimbSubsystem.java Outdated
Comment thread src/main/java/frc/robot/subsystems/ClimbSubsystem.java Outdated
Comment thread src/main/java/frc/robot/subsystems/ClimbSubsystem.java Outdated
Comment thread src/main/java/frc/robot/subsystems/ClimbSubsystem.java Outdated
Comment thread src/main/java/frc/robot/subsystems/ClimbSubsystem.java Outdated
Comment thread src/main/java/frc/robot/subsystems/ClimbSubsystem.java Outdated
Comment thread src/main/java/frc/robot/Subsystems.java
Comment thread src/main/java/frc/robot/Subsystems.java
Comment thread src/main/java/frc/robot/subsystems/ClimbSubsystem.java Outdated

private final FlywheelSim motorSim;

public Climb() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I "think" you meant for this to be the constructor. If so you need to name it the same as the class. ClimbSubsystem() instead of Climb().

Comment thread src/main/java/frc/robot/subsystems/ClimbSubsystem.java

@Override
public void periodic() {
//add stuff later

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Best practice is to use // TODO:

Comment thread src/main/java/frc/robot/Subsystems.java
@koolpoolo

Copy link
Copy Markdown
Contributor

closing this pr as it not getting mechanically built

@koolpoolo koolpoolo closed this Oct 2, 2026
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.

3 participants