LimeLight branch closing#9
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates LimeLight/localized aiming support by renaming and retuning the AprilTag aiming helper, wiring it into multiple TeleOp/test OpModes, and updating several Road Runner localization/tuning settings.
Changes:
- Replaces
AprilTagAimerusage with the newAimerclass and updates localized aiming telemetry/output. - Adjusts localization/tuning parameters (Pinpoint offsets/directions, mecanum model params) and tightens AntiDefense heading tolerance.
- Re-enables Road Runner tuning opmode registration in
TuningOpModes.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/testing/LocalizedAimingTester.java | Switches to Aimer, updates pose estimate updates, and expands aiming telemetry (incl. bearing). |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/testing/DistanceRegressionTeleOp.java | Switches from AprilTagAimer to Aimer. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/testing/AprilTagTester.java | Switches from AprilTagAimer to Aimer and removes unused imports. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/teleop/BotPeriodics.java | Switches stored aimer type from AprilTagAimer to Aimer. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/limelight/Aimer.java | Renames/retunes the aiming helper and changes localized turn power return payload (adds bearing). |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/AntiDefense.java | Adds angle clamping and tightens angular tolerance. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auto/utils/Hardware.java | Switches stored aimer type from AprilTagAimer to Aimer. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auto/utils/BotActions.java | Switches stored aimer type from AprilTagAimer to Aimer and cleans imports. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auto/roadrunner/tuning/TuningOpModes.java | Uncomments opmode registrar (tuning opmodes now register when DISABLED=false). |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auto/roadrunner/miscRR/PinpointLocalizer.java | Updates encoder offsets and reverses encoder directions. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auto/roadrunner/miscRR/MecanumDrive.java | Updates drive constants and changes IMU/lazyImu field handling. |
Comments suppressed due to low confidence (2)
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/limelight/Aimer.java:63
angleWrapDegreesuses Java’s%on potentially unbounded angles (your comment notesheading.toDouble()isn’t clamped). For large negative angles,(angle + 180) % 360 - 180can return values outside [-180, 180] (e.g., -720° becomes -360°), which will break the aiming correction. Consider using a wrap implementation that handles negative values correctly (e.g.,Math.floorModor a double-mod pattern).
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auto/roadrunner/tuning/TuningOpModes.java:130- This PR uncomments the
@OpModeRegistrar register(...)method, andDISABLEDisfalse, so all Road Runner tuning op modes will now be registered on the robot. If this wasn’t intended for competition builds, consider settingDISABLED = true(or restoring the comment/guarding with a build flag) to avoid cluttering the op mode list and accidentally running tuners on-field.
@OpModeRegistrar
public static void register(OpModeManager manager) {
if (DISABLED) return;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@arnavjosh I've opened a new pull request, #10, to work on those changes. Once the pull request is ready, I'll request review from you. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (3)
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auto/roadrunner/tuning/TuningOpModes.java:130
- This change effectively uncomments the
@OpModeRegistrar register(...)method whileDISABLEDis set tofalse, which will register all tuning opmodes on the Driver Station. If these are not intended to ship in this branch, setDISABLED = true(or re-comment the block) so the opmode list isn’t polluted in competition builds.
@OpModeRegistrar
public static void register(OpModeManager manager) {
if (DISABLED) return;
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/limelight/Aimer.java:37
HardwareMap hardwareMapis accepted byAimer's constructor but never used. IfAimerdoesn’t need hardware access, drop the parameter to avoid implying side effects/required initialization; otherwise, use it (or at least annotate/suppress) so unused-parameter warnings don’t get ignored broadly.
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/limelight/Aimer.java:63angleWrapDegreesuses the%operator, which in Java keeps the sign of the dividend. For negative inputs this can return values outside [-180, 180] (e.g., -200 stays -200), which will produce incorrect turn corrections near wrap boundaries. Consider usingMath.floorMod(or a double-safe equivalent) to properly wrap degrees into [-180, 180] before feeding the PID and returningbearing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Before issuing a pull request, please see the contributing page.