Skip to content

Refactor constants to UPPER_SNAKE_CASE and misc cleanup#192

Merged
nlaverdure merged 8 commits into
mainfrom
refactor/constants-naming-convention
Jun 4, 2026
Merged

Refactor constants to UPPER_SNAKE_CASE and misc cleanup#192
nlaverdure merged 8 commits into
mainfrom
refactor/constants-naming-convention

Conversation

@nlaverdure

@nlaverdure nlaverdure commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Rename all public static final constants across shared constants files (Constants, DriveConstants, FeederConstants, IntakeConstants, LauncherConstants, VisionConstants, LEDConstants) to UPPER_SNAKE_CASE per Java convention; k-prefix gain fields left unchanged per FRC convention
  • Move unique PID gains out of shared constants files into their respective sim IO classes
  • Centralize shared PID gains into shared constants files so real and sim IO implementations share one source of truth
  • Package together associated constants into Records:
    • CameraConfig pairs up a camera name with its associated robot-to-camera transform
    • RollerConfig was simplified from a class to a Record
  • Remove redundant FREE_SPEED constants from motor constant classes
  • Use stator current limits for REV motor controllers
  • Normalize all line endings to LF via .gitattributes

Test plan

  • Robot code compiles without errors (./gradlew build)
  • Sim mode runs and drive/launcher/feeder/intake subsystems behave as expected
  • Vision pipeline initializes correctly with new CameraConfig records
  • No CRLF line-ending regressions (git diff --check)

🤖 Generated with Claude Code

nlaverdure and others added 8 commits June 4, 2026 10:42
- Apply camelCase convention to all shared constants files (Constants,
  DriveConstants, FeederConstants, LauncherConstants, IntakeConstants)
- Apply UPPER_SNAKE_CASE to private static final fields in IO implementation classes
- Move sim-only DCMotor/gain constants out of shared constants into their
  respective sim IO classes (TurretIOSimSpark, FlywheelIOSimWPI,
  KickerIOSimSpark, SpindexerIOSimSpark, RollerIOSimSpark/TalonFX)
- Merge TurretIOSpark and TurretIOSimSpark gains into common kP/kD
  fields in TurretConstants

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All public/private static final fields in Constants, DriveConstants,
LauncherConstants, FeederConstants, IntakeConstants, and VisionConstants
now use UPPER_SNAKE_CASE per Java convention. k-prefix gain constants
(kP, kD, kAllowableError, etc.) are left unchanged per FRC convention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add .gitattributes enforcing eol=lf for all text files, and convert
all existing tracked files from CRLF to LF.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The blanket .vscode/ rule at the bottom conflicted with the selective
allowlist above it (.vscode/settings.json, launch.json, etc.). Removing
it so the allowlist takes effect and tracked .vscode files remain tracked.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntralize roller gains

Extends the naming convention refactor to VisionConstants, DriveConstants,
FeederConstants, LauncherConstants, LEDConstants, and general Constants;
centralizes shared roller PID/torque gains into IntakeConstants.RollerConstants
so real and sim IO classes share a single source of truth.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the separate CAMERA_*_NAME and ROBOT_TO_*_CAMERA constants with a
CameraConfig record, and updates VisionIOPhotonVision and VisionIOPhotonVisionSim
to accept a CameraConfig directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Completes UPPER_SNAKE_CASE constant renaming across drive, feeder, intake,
and launcher subsystems. Also removes unused FREE_SPEED constants from motor
classes and adjusts default current limits to safer values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds *.glb binary to .gitattributes so line-ending normalization never
touches GLB files. Restores model.glb to its pre-normalization state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nlaverdure nlaverdure merged commit cfcecb6 into main Jun 4, 2026
2 checks passed
@nlaverdure nlaverdure deleted the refactor/constants-naming-convention branch June 4, 2026 17:53
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.

1 participant