Skip to content

Add Color view - #234

Open
vedants15 wants to merge 2 commits into
acmerobotics:masterfrom
6165-MSET-Cuttlefish:color-view
Open

vedants15 wants to merge 2 commits into
acmerobotics:masterfrom
6165-MSET-Cuttlefish:color-view

Conversation

@vedants15

Copy link
Copy Markdown

Summary

Color view compares a live I2C color sensor against an expected color, aimed at answering "is my color sensor seeing what I think it's seeing?" at the field.

  • Type a hex, rgb(r, g, b), or bare r, g, b — or pick from presets (Red, Orange, Yellow, Green, Blue, Purple, White, Black)
  • Side-by-side Expected / Sensed swatches with a stats table (hex, RGB, hue, sat, val) and a ΔE tolerance that drives a Match / No match badge
  • Matching uses CIEDE2000 on brightness-normalized colors, so a correct hue/saturation reading matches regardless of ambient light or distance to the object
  • Normalization modes (auto / 8-bit / alpha / manual divisor) for sensors that report raw counts on different scales
  • HardwareOpMode now also publishes the sensor's alpha channel

Testing

  • Mock server: TestColorSensorOpMode (run with ./gradlew :DashboardCore:runTestServer)
  • On-robot: ColorViewDemoOpMode in TeamCode
  • Verified in the browser in both light and dark mode (see screenshots/video)
01-both-views 02-color-match 04-color-no-match 06-color-rematch 07-both-views-dark
color-and-looptime-demo.mp4

mxtmx added a commit to 6165-MSET-Cuttlefish/slothboard that referenced this pull request Sep 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants