Skip to content

Conversation

@Jetblackdragon
Copy link
Contributor

No description provided.

Copy link

@markpete markpete left a comment

Choose a reason for hiding this comment

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

Let's see if we can get rid of the redundant code and make this more maintainable.

markpete
markpete previously approved these changes Oct 24, 2025
Copy link
Contributor

@koolpoolo koolpoolo left a comment

Choose a reason for hiding this comment

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

sigma

blueBranchI,
blueBranchJ,
blueBranchK,
blueBranchL)
Copy link
Member

Choose a reason for hiding this comment

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

List.of returns an immutable object, so each of these lists could just be assigned to a static final class variable and then used instead of calling List.of() and recreating these fixed lists all the time. Not blocking - just an area for improvement.

spinnyClaw.stop())
.withTimeout(0.5),
repeatPrescoreScoreSwing(
Commands.repeatingSequence(
Copy link
Member

Choose a reason for hiding this comment

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

Seems odd to have a repeating sequence passed in to a function that repeats the passed in command. Is that intentional?

Copy link
Member

Choose a reason for hiding this comment

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

Other than that, this is identical to coralLevelTwo() but with different constants for a few things. If they should match other than constants, it'd be useful to rework this post-comp to remove the duplicated code (via a template function or some other method)

.until(ipScore)
.until(score)),
spinnyClaw.stop())
.withTimeout(0.5),
Copy link
Member

Choose a reason for hiding this comment

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

The .withTimeout() values (e.g., 0.5, 1.5) are hardcoded. Consider defining these as constants or configurable parameters to make the code easier to maintain and tune.

armPivot
.moveToPosition(ArmPivot.CORAL_PRESET_DOWN)
.withTimeout(1.5)
.until(armPivot.atAngle(ArmPivot.CORAL_POST_SCORE))),
Copy link
Member

Choose a reason for hiding this comment

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

There is no explicit error handling in case the subsystems fail to reach their target positions. Consider adding fallback logic or logging to handle such cases. Once physical simulation of the subsystems are implemented, tweaking parameters there (to make them move slower or faster) would allow testing of the error handling here.

@markpete

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as spam.

@markpete
Copy link

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a significant refactoring of the auto-alignment and scoring logic, notably by adding AllianceUtils, ScoringType, and AlignType to improve code structure and reduce duplication. The Shuffleboard layout in elastic-layout.json has also been completely reorganized. My review focuses on improving performance by avoiding repeated object creation in AutoAlign, enhancing maintainability by removing magic numbers, and fixing a potential regression in the controller rumble feedback for scoring alignment. I also suggest a small improvement to the new AllianceUtils class to follow best practices.

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.

6 participants