Skip to content

feat(hardware-testing,api,shared-data): Add TOF-Analysis tool to generate, plot, and validate baselines and measurements + related improvements. #18875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 51 commits into from
Jul 14, 2025

Conversation

vegano1
Copy link
Contributor

@vegano1 vegano1 commented Jul 10, 2025

Overview

This pull request consolidates the TOF sensor tooling scattered across various branches into a single tof-analysis tool. This tool lets you generate baselines, plot baselines + measurements, and validate baselines for labware detection. It updates the baseline format to include version and platform for each baseline, and generates new baselines in the FlexStackerModuleV1.json file using over 1800 new measurement samples to greatly increase labware detection accuracy. There are a lot of file changes, but that's from moving the stacker QC tests into a stacker directory.

plus a few other cleanup changes.

TOF-Analysis Tool

baseline_plot labware_plot

Test Plan and Hands on Testing

  • Test the new baseline on the Flex using various labware, and it can dispense/store said labware.
  • Make sure variations of labware colors are detectable on the X-retract and Z-extend positions.

Changelog

  • Add tof-analysis tool to generate, plot, and validate baselines + measurements.
  • Generate a new baseline with a standard deviation of 5 for all axes and directions.
  • Move TOF_DETECTION_CONFIG, STALLGUARD_CONFIG, and STACKER_MOTION_CONFIG out of the driver and into the flex_stacker.py file, which is the only place that uses them.
  • Update the TOF_DETECTION_CONFIG with new values
    • Update the bin range Z-Extend (30, 40), Z-Retract (17, 30), X-Extend (15, 63), X-Retract (15, 63)
    • Add the Direction.RETRACT direction to the TOF_DETECTION_CONFIG for the Z axis
    • Decrease raw photon threshold to 1000
  • Update the STALLGUARD_CONFIG from 2 -> 0 per hardware testing. @Carlos-fernandez

Review requests

Risk assessment

@vegano1 vegano1 requested review from a team as code owners July 10, 2025 16:06
@vegano1 vegano1 requested review from TamarZanzouri, djgomez-opentrons, a team and Carlos-fernandez and removed request for a team July 10, 2025 16:06
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Looks good to me. I hope we get a second pass at the thresholding someday.

Co-authored-by: Seth Foster <seth@opentrons.com>
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 23.79%. Comparing base (41c97ad) to head (2de7f78).
Report is 8 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #18875      +/-   ##
==========================================
- Coverage   25.39%   23.79%   -1.61%     
==========================================
  Files        3333     3333              
  Lines      287572   287598      +26     
  Branches    36508    35907     -601     
==========================================
- Hits        73042    68433    -4609     
- Misses     214507   219139    +4632     
- Partials       23       26       +3     
Flag Coverage Δ
protocol-designer 19.01% <ø> (ø)
step-generation 5.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ta/python/opentrons_shared_data/module/__init__.py 82.22% <ø> (+3.49%) ⬆️
...-data/python/opentrons_shared_data/module/types.py 100.00% <ø> (ø)

... and 116 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vegano1 vegano1 removed the request for review from TamarZanzouri July 10, 2025 18:23
Copy link
Contributor

@djgomez-opentrons djgomez-opentrons left a comment

Choose a reason for hiding this comment

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

Looks great

@vegano1 vegano1 merged commit 1cb77b3 into edge Jul 14, 2025
95 of 102 checks passed
@vegano1 vegano1 deleted the flex-stacker-tof-data-analysis branch July 14, 2025 21:11
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.

6 participants