Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds vendor-specific motor/sensor adapter modules (CTRE Phoenix 6 + REV Spark) on top of new core actuator/sensor abstractions in nrgcommon, enabling hardware-agnostic motor construction via Motors.
Changes:
- Introduces new core actuator/sensor interfaces/types (
MotorController,Motors,RelativeEncoder,LimitSwitch, etc.) and a null adapter. - Adds
nrgcommon-ctreandnrgcommon-revGradle subprojects with CTRE TalonFX and REV SparkMax/SparkFlex adapter implementations. - Wires new subprojects into the multi-project build via
settings.gradle.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle | Includes new nrgcommon-ctre and nrgcommon-rev subprojects. |
| nrgcommon/src/main/java/com/nrg948/sensor/RelativeEncoder.java | Adds a vendor-agnostic relative encoder interface. |
| nrgcommon/src/main/java/com/nrg948/sensor/LimitSwitch.java | Adds a vendor-agnostic limit switch interface. |
| nrgcommon/src/main/java/com/nrg948/actuator/package-info.java | Documents actuator package purpose and vendor module usage. |
| nrgcommon/src/main/java/com/nrg948/actuator/NullMotorAdapter.java | Provides a no-op MotorController implementation. |
| nrgcommon/src/main/java/com/nrg948/actuator/Motors.java | Adds motor-type enum + reflection-based adapter construction. |
| nrgcommon/src/main/java/com/nrg948/actuator/MotorIdleMode.java | Adds idle-mode enum for adapters. |
| nrgcommon/src/main/java/com/nrg948/actuator/MotorDirection.java | Adds direction/inversion abstraction for adapters. |
| nrgcommon/src/main/java/com/nrg948/actuator/MotorController.java | Defines the common motor controller interface (+ sensors, follower, telemetry). |
| nrgcommon-rev/src/main/java/com/nrg948/sensor/rev/SparkLimitSwitchAdapter.java | Adapts REV Spark limit switches to LimitSwitch. |
| nrgcommon-rev/src/main/java/com/nrg948/sensor/rev/SparkEncoderAdapter.java | Adapts REV encoders to RelativeEncoder. |
| nrgcommon-rev/src/main/java/com/nrg948/actuator/rev/SparkMaxAdapter.java | Implements MotorController for SparkMax. |
| nrgcommon-rev/src/main/java/com/nrg948/actuator/rev/SparkFlexAdapter.java | Implements MotorController for SparkFlex. |
| nrgcommon-rev/src/main/java/com/nrg948/actuator/rev/SparkAdapter.java | Common base for Spark adapters incl. config + telemetry + follower logic. |
| nrgcommon-rev/build.gradle | Adds REV module build/publish configuration and dependencies. |
| nrgcommon-rev/.styleguide-license | Adds Spotless license header template for REV module. |
| nrgcommon-ctre/src/main/java/com/nrg948/sensor/ctre/TalonFXLimitSwitchAdapter.java | Adapts TalonFX limit signals to LimitSwitch. |
| nrgcommon-ctre/src/main/java/com/nrg948/sensor/ctre/TalonFXEncoderAdapter.java | Adapts TalonFX position/velocity to RelativeEncoder. |
| nrgcommon-ctre/src/main/java/com/nrg948/actuator/ctre/TalonFXAdapter.java | Implements MotorController for TalonFX + follower + telemetry. |
| nrgcommon-ctre/build.gradle | Adds CTRE module build/publish configuration and dependencies. |
| nrgcommon-ctre/.styleguide-license | Adds Spotless license header template for CTRE module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nrgcommon-ctre/src/main/java/com/nrg948/actuator/ctre/TalonFXAdapter.java
Outdated
Show resolved
Hide resolved
nrgcommon-ctre/src/main/java/com/nrg948/actuator/ctre/TalonFXAdapter.java
Show resolved
Hide resolved
nrgcommon-rev/src/main/java/com/nrg948/actuator/rev/SparkAdapter.java
Outdated
Show resolved
Hide resolved
nrgcommon-rev/src/main/java/com/nrg948/actuator/rev/SparkMaxAdapter.java
Outdated
Show resolved
Hide resolved
nrgcommon-rev/src/main/java/com/nrg948/actuator/rev/SparkAdapter.java
Outdated
Show resolved
Hide resolved
179f773 to
99dd88a
Compare
paulwdavis
reviewed
Mar 29, 2026
nrgcommon-ctre/src/main/java/com/nrg948/actuator/ctre/TalonFXAdapter.java
Show resolved
Hide resolved
nrgcommon-ctre/src/main/java/com/nrg948/actuator/ctre/TalonFXAdapter.java
Show resolved
Hide resolved
nrgcommon-ctre/src/main/java/com/nrg948/sensor/ctre/TalonFXEncoderAdapter.java
Outdated
Show resolved
Hide resolved
nrgcommon-ctre/src/main/java/com/nrg948/actuator/ctre/TalonFXAdapter.java
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes moves the CTRE & Rev motor controller adapters from the robot code to the NRGCommon library.