Skip to content

Add support for REV Color Sensor V3 - #523

Merged
alan412 merged 10 commits into
wpilibsuite:mainfrom
lizlooney:pr_ColorSensorV3
Sep 1, 2026
Merged

Add support for REV Color Sensor V3#523
alan412 merged 10 commits into
wpilibsuite:mainfrom
lizlooney:pr_ColorSensorV3

Conversation

@lizlooney

Copy link
Copy Markdown
Collaborator

Overview

Add support for REV Color Sensor V3, including blocks to get hue, saturation, and lightness from a wpiutil.Color value and blocks that tell whether a color is close to red, yellow, green, cyan, blue, or magenta.

Linked Issues

Fixes #453

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that causes existing functionality to change)
  • Documentation update
  • Code style/formatting updates
  • Refactoring / Renaming
  • Other

How Has This Been Tested?

I created a new project and added a ColorSensorV3 component to my robot. I added code to my teleop to get the proximity and color from the sensor; print the hue, saturation, and value; print whether the color is red, yellow, green, cyan, blue, or magenta.
I tested this with a REV Color Sensor V3 plugged into an I2C port on Systemcore, using a custom-made cable.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have run through the [docs/testing_before_pr_checklist.md]

Updated python_tools to code that processes function signatures.
Moved everything to python_data_toolbox.ts, but instead of always using robotPyData, getToolboxCategoriees takes a pythonData argument.
Changed robotpy_toolbox getToolboxCategories to call python_data_toolbox getToolboxCategories with robotPyData
@lizlooney
lizlooney requested a review from alan412 August 23, 2026 06:26

@alan412 alan412 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it on my systemcore and it worked. :-). Some minor nits in my review.

Comment thread frontend/toolbox/python_data_toolbox.ts Outdated
Comment thread runtime_python/wpilib_blocks/color.py
Comment thread runtime_python/wpilib_blocks/color.py Outdated

@alan412 alan412 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the way you broke out _is_colorful_enough_to_detect_color and the tests

@alan412
alan412 merged commit 3333e6a into wpilibsuite:main Sep 1, 2026
1 check passed
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.

Need component for Range/Color Sensor

2 participants