Conversation
new changes
working auto aim + autonomous after regio
Update android app version
…priltag not detected.
codul de la regio + auto lui robert
Merge auto-aim based on limelight
Recorder and replay op
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR syncs the codebase with a “Limelight implementation from main” by adding a Limelight subsystem, integrating it into turret auto-aim + driver controls, and aligning supporting utilities/constants (I2C expander packaging/imports, build SDK level).
Changes:
- Added a Limelight subsystem to
Robotwith polling, pipeline switching, result freshness handling, and telemetry; turret auto-aim can now use Limelighttxcorrection when available. - Introduced a new
I2cLcddriver built on thePCF8574I/O expander and cleaned up PCF8574 packaging/import usage. - Updated constants (Limelight tuning + basket coordinates) and bumped
compileSdkVersioninbuild.common.gradle.
Reviewed changes
Copilot reviewed 7 out of 7 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/kronbot/utils/devices/PCF8574.java | Fixes package declaration to match directory and support direct imports. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/Constants.java | Adds Limelight tuning constants and updates basket Y coordinates. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/components/I2cLedBar.java | Updates PCF8574 import to match package fix. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/components/I2cLcd.java | Adds new LCD driver via PCF8574 (currently has correctness issues noted in comments). |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/Robot.java | Adds Limelight subsystem + turret integration; includes minor cleanup opportunities. |
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/MainDrivingOp.java | Initializes/stops Limelight, adds telemetry, and switches pipeline on target toggle (also exposes a double-toggle bug). |
| build.common.gradle | Updates compile SDK level to 36 (aligns with FtcRobotController module’s compileSdkVersion). |
Suppressed comments (4)
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/components/I2cLcd.java:111
- writeData() doesn't properly strobe the EN line for the high nibble: it raises EN but never drops it with data held stable, and it also doesn't mask the shifted low nibble. This can prevent characters from latching correctly on the LCD.
byte snd = (byte)((data & 0xF0 | RS_BIT | backlight));
pcf.writeByte(snd | EN_BIT);
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/components/I2cLcd.java:129
- writeCommand() has the same EN-strobe issue as writeData(): it raises EN for the high nibble but never drops it while data is stable, which can corrupt command writes. It should pulse EN high then low for each nibble.
byte snd = (byte)((cmd & 0xF0) | backlight);
pcf.writeByte(snd | EN_BIT);
snd = (byte)((cmd << 4) | backlight);
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/components/I2cLcd.java:153
- read() overwrites the first (high) nibble with the second (low) nibble, so the returned byte is incorrect and busy() can behave unpredictably. The second nibble should be OR'ed into the low 4 bits, not replace the whole value.
pcf.writeByte(snd | EN_BIT);
readData = (byte)(pcf.readByte() & 0xF0);
pcf.writeByte(snd);
pcf.writeByte(snd | EN_BIT);
readData = (byte)(pcf.readByte() >> 4);
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/components/I2cLcd.java:169
- setBacklight() never clears the backlight bit when backlightOn is false, and the immediate write always sends BL_BIT even when turning off. This makes it impossible to reliably turn the backlight off and can desync the cached backlight state from what was sent.
public void setBacklight(boolean backlightOn, boolean immediate) {
if(backlightOn)
backlight = BL_BIT;
if(immediate)
pcf.writeByte(BL_BIT);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case 3: | ||
| address += 60; | ||
| break; |
| import com.qualcomm.hardware.limelightvision.LLResult; | ||
| import com.qualcomm.hardware.limelightvision.LLResultTypes; | ||
| import com.qualcomm.hardware.limelightvision.LLStatus; | ||
| import com.qualcomm.hardware.limelightvision.Limelight3A; | ||
|
|
||
| import com.qualcomm.robotcore.util.ElapsedTime; |
| private static final int POLL_RATE_HZ = 30; | ||
| private static final int PIPELINE_INDEX = 7; | ||
| private static final long STALE_RESULT_MS = 500; |
| if(drivingGP.rightStick.button.justPressed()) { | ||
| robot.Blue_Target = !robot.Blue_Target; | ||
| robot.limelight.switchPipeline(robot.Blue_Target); | ||
| } |
Before issuing a pull request, please see the contributing page.