Skip to content

Add Broadcom-style postprocessing for APDS9151 color readings in SRSHub#31

Closed
raahilparikh wants to merge 1 commit intov2-devfrom
codex/implement-postprocessing-for-color-values
Closed

Add Broadcom-style postprocessing for APDS9151 color readings in SRSHub#31
raahilparikh wants to merge 1 commit intov2-devfrom
codex/implement-postprocessing-for-color-values

Conversation

@raahilparikh
Copy link
Copy Markdown

Motivation

  • The APDS9151 I2C device exposed by SRSHub provided raw color channel integers that need the same postprocessing/normalization RevColorSensorV3 performs so higher-level code can use RGB/alpha values consistently.

Description

  • Added raw color fields (rawInfrared, rawRed, rawGreen, rawBlue) and postprocessed outputs (red, green, blue, alpha, infrared) to SRSHub.APDS9151 in TeamCode/src/main/java/org/firstinspires/ftc/teamcode/util/SRSHub.java.
  • Implemented postProcessColors() which subtracts infrared from each channel, clamps negatives, finds the max channel, scales channels to a 0–255 range (Broadcom-style normalization), and computes alpha and scaled infrared.
  • Updated parseUpdate() to store raw values from the incoming BitSet into the new raw fields and call the postprocessing step after reading the raw channels.

Testing

  • No automated tests were executed as part of this change.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant