Skip to content

Reorganize frc.lib and frc.robot.util into cohesive packages #12

@nlaverdure

Description

@nlaverdure

Problem

frc.lib and frc.robot.util are both grab-bag "miscellaneous" packages with overlapping/unclear scope:

  • frc.lib (12 files): controller/HID classes, match-setup selectors, hardware logging wrappers, and a generic Util interface.
  • frc.robot.util (7 files): vendor-specific odometry threads, a vision thread, an AdvantageKit pathfinding helper, and a system-health monitor.

Two similarly-vague "misc" packages make it hard to find related code and invites further dumping of unrelated classes.

Proposed layout

Group by domain instead of by "is it reusable across robots" vs "is it specific to this robot":

frc.lib.input (controller/HID)

  • ZorroController.java
  • CommandZorroController.java
  • ControllerSelector.java

frc.lib.autoselect (match setup / autonomous selection)

  • AllianceSelector.java
  • AllianceSelectorIO.java
  • AutoOption.java
  • AutoSelector.java
  • AutoSelectorIO.java

frc.lib.hardware (logged/simulated hardware wrappers)

  • LoggedCompressor.java
  • LoggedPowerDistribution.java
  • PneumaticsSimulator.java
  • KernelLogMonitor.java (moved from frc.robot.util)

frc.lib (root, kept minimal)

  • Util.java (generic helpers: allianceToColor, nearlyEqual)

frc.robot.util.odometry (vendor-specific odometry threads/helpers)

  • CanandgyroThread.java
  • SparkOdometryThread.java
  • PhoenixUtil.java
  • SparkUtil.java

Move out of frc.robot.util entirely:

  • VisionThread.java -> frc.robot.subsystems.vision (already imports heavily from there)
  • LocalADStarAK.java -> frc.robot.auto (AdvantageKit pathfinding helper, belongs with autonomous code)

Notes

  • This is a pure repackaging (import-path updates only), touching ~19 files plus all referencing files across the codebase.
  • Hold until the WPILib 2027 alpha migration (main-2027) is unblocked and merged, to avoid compounding two large mechanical diffs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions