leds for vision indication#101
Conversation
🤖 Augment PR SummarySummary: Adds a vision-health LED indicator and supporting health checks. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
| LEDPattern base = LEDPattern.gradient(LEDPattern.GradientType.kDiscontinuous, Color.kYellow, Color.kBlue); | ||
| LEDPattern pattern = base.scrollAtRelativeSpeed(Percent.per(Second).of(100)); | ||
|
|
||
| return run(() -> { |
There was a problem hiding this comment.
Unlike runPattern(...), this command doesn’t call ignoringDisable(true), so the default vision-status LEDs may stop updating while the robot is disabled (and can leave stale colors). Consider whether you want the vision-health indicator to keep running in disabled like the other LED commands.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| return true; | ||
| } | ||
|
|
||
| Pose2d currentPose = readings.get(0).robotPose().estimatedPose.toPose2d(); |
There was a problem hiding this comment.
After periodic() sorts allValidReadings oldest-first, readings.get(0) selects the oldest reading (often from a different camera), which can make dt out-of-order and misclassify pose flicker. Consider basing this on the newest timestamped reading (and using CameraReading.timestampSeconds() for consistency).
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
We also don't necessarily want to do this check with only one reading.. mmm idk I think this needs further thinking
| }); | ||
| } | ||
|
|
||
| public boolean areCamerasConnected() { |
There was a problem hiding this comment.
I don't think we want to be sad if one camera is not connected. Maybe check for 2+ cameras disconnected instead; or at least make this a changeable constant.
|
|
||
| public boolean isVisionUpdating() { | ||
| double currentTime = Timer.getFPGATimestamp(); | ||
| return (currentTime - m_lastTimestamp) < 0.5; |
There was a problem hiding this comment.
Please also make this magic number a constant.
| return (currentTime - m_lastTimestamp) < 0.5; | ||
| } | ||
|
|
||
| public boolean hasValidTargets() { |
There was a problem hiding this comment.
This is going to be false whenever we can't see any apriltags. I don't think this is a good indication of whether or not vision is overall healthy -- there are times where I think we won't be able to see apriltags.
| return true; | ||
| } | ||
|
|
||
| Pose2d currentPose = readings.get(0).robotPose().estimatedPose.toPose2d(); |
| return !allValidReadings.isEmpty(); | ||
| } | ||
|
|
||
| public boolean isVisionPoseStable() { |
There was a problem hiding this comment.
For this, you might want to copy paste the isPoseJumpy() stuff from last year. I'm also not sure if this is a good indication of vision health.
| return true; | ||
| } | ||
|
|
||
| Pose2d currentPose = readings.get(0).robotPose().estimatedPose.toPose2d(); |
There was a problem hiding this comment.
We also don't necessarily want to do this check with only one reading.. mmm idk I think this needs further thinking
| m_lastVisionPoseTimestamp = timestamp; | ||
|
|
||
| // if robot seems like it's jumping > 1 meter in < 0.1s → probably est pose is flickering too much | ||
| return !(distanceJump > 1.0 && dt < 0.1); |
There was a problem hiding this comment.
In the future, please make these constants.
| return runPattern(pattern).withName("LED/scrolling yellow-blue"); | ||
| } | ||
|
|
||
| public Command runVisionStatus(java.util.function.BooleanSupplier visionHealthySupplier) { |
There was a problem hiding this comment.
Create a trigger on isVisionHealthy() instead, and bind the trigger to the LED pattern instead
check to see if multiple cameras are disconnected
commit 13f0e79 Author: zoe z <121075323+amzoeee@users.noreply.github.com> Date: Tue Mar 10 11:18:08 2026 -0700 test displace fuel + run column backwards in intake (#104) * update displace fuel timing and position * add intake command commit 8d48f71 Author: zoe z <121075323+amzoeee@users.noreply.github.com> Date: Tue Mar 10 11:17:48 2026 -0700 organize shoot commands (+ fix shootToHub) (#98) * fix whitespace + comments * use parallel group of sequences in shoottohub * add command names * fix shootWithoutDistance javadoc * remove snapToHub timeout? commit 7bc05cf Author: zoe z <121075323+amzoeee@users.noreply.github.com> Date: Tue Mar 10 09:22:22 2026 -0700 add snapForBump command (#97) * add snapForBump * remove unused import * use snap to angle for snap for bump * fix snap to angle logging statement * add names to drivetrain snap to X * fix comments commit d8c257c Author: aishahnazar <aishahnazar2@gmail.com> Date: Mon Mar 9 19:26:14 2026 -0700 add front camera (#99) * add front camera * update constants for front camera * remove comments --------- Co-authored-by: zoe <zoe.z.zhao@gmail.com>
This reverts commit 5dc67b7.
currently has 4 checks: