Skip to content

Conversation

ShmayaR
Copy link
Collaborator

@ShmayaR ShmayaR commented Sep 27, 2025

Summary by CodeRabbit

  • Refactor
    • Removed reef side toggle and clock-position controls from operator bindings; reef side/clock-position options no longer exposed to operators.
    • Simplified reef-target logic by removing an exposed placement-calculation routine.
    • Updated L1 scoring preset for the arm/elevator to a new angle and height for improved placement.

Copy link

coderabbitai bot commented Sep 27, 2025

Walkthrough

This change removes reef-side and clock-position APIs, bindings, and state from ReefChooser and renames an internal helper; removes a public placing-position method from CoralPlacingCommands; and updates the ArmElevatorState.SCORE_L1 angle and elevator position. No new files added.

Changes

Cohort / File(s) Summary
ReefChooser API and state removal
src/main/java/frc/trigon/robot/misc/ReefChooser.java
Deleted public methods: switchReefSide(), getClockPosition(), getReefSide(), calculateTargetScoringPose(). Removed clock-position operator bindings, related command factory, and clockPosition field. Renamed private helper setFaceFromIndex(int)setFaceSideFromIndex(int). Removed unused FlippablePose2d import.
Arm elevator scoring target tweak
src/main/java/frc/trigon/robot/subsystems/arm/ArmElevatorConstants.java
Updated ArmElevatorState.SCORE_L1: angle 45° → 70° and elevator position 0.603 m → 0.4 m; other enum fields unchanged.
Coral placing API reduction
src/main/java/frc/trigon/robot/commands/commandfactories/CoralPlacingCommands.java
Removed public method public FlippablePose2d calculateTargetPlacingPosition(FieldConstants.ReefClockPosition, FieldConstants.ReefSide) from ScoringLevel enum (Javadoc and implementation removed).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Op as Operator
  participant RC as ReefChooser
  participant Arm as Arm/Elevator
  participant Field as Field Constants
  participant Coral as CoralPlacingCommands

  rect rgba(230,245,255,0.6)
  note over Op,RC: Previous flow (with clock/side APIs)
  Op->>RC: Toggle reef side / set clock position
  RC->>Field: Resolve ReefSide/ClockPosition
  RC->>Arm: Calculate target scoring pose
  Coral->>Arm: calculateTargetPlacingPosition(...) (was callable)
  Arm-->>Op: Move to target
  end

  rect rgba(240,240,240,0.6)
  note over Op,RC: New flow (after removals)
  Op -x RC: No direct clock/side/pose APIs
  RC--xArm: No target scoring pose calculation
  Coral -x Arm: public calculateTargetPlacingPosition removed
  note over Op,Arm: Targeting handled elsewhere or via remaining APIs
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I nudge the code with a whiskered grin,
Clock hands fade; new angles begin.
L1 lifts at seventy—what a leap!
Reef-side whispers settle into sleep.
Thump-thump—merge done, I hop home to sleep. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The title “Remove Unused Code” is too generic and only captures the deletions, omitting the significant change to the SCORE_L1 elevator constant, so it does not clearly convey the full scope of the pull request. Please update the title to something more descriptive such as “Remove unused ReefChooser and ScoringLevel methods and update SCORE_L1 elevator constants” so that it accurately reflects both the code removals and the constant adjustment.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-unused-code

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7284106 and 4678043.

📒 Files selected for processing (1)
  • src/main/java/frc/trigon/robot/commands/commandfactories/CoralPlacingCommands.java (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/main/java/frc/trigon/robot/commands/commandfactories/CoralPlacingCommands.java

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@levyishai levyishai merged commit 760e125 into main Sep 27, 2025
4 checks passed
@levyishai levyishai deleted the remove-unused-code branch September 27, 2025 22:59
This was referenced Sep 28, 2025
@coderabbitai coderabbitai bot mentioned this pull request Oct 5, 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