Skip to content

feat(opentrons): add new-architecture OT-2 driver - #1193

Draft
rickwierenga wants to merge 1 commit into
mainfrom
feat/opentrons-ot2-driver
Draft

feat(opentrons): add new-architecture OT-2 driver#1193
rickwierenga wants to merge 1 commit into
mainfrom
feat/opentrons-ot2-driver

Conversation

@rickwierenga

Copy link
Copy Markdown
Member

Summary

Adds an Opentrons OT-2 driver following PyLabRobot's new device architecture.

The driver lives in pylabrobot/opentrons/ot2/ and models each mounted pipette as an OT2Pipette object. It communicates directly with the robot's HTTP API through a new asynchronous JSON-over-HTTP transport.

Features

  • Discover left and right mounted pipettes during setup
  • Support Gen1 and Gen2 single-channel OT-2 pipettes
  • Home the robot and move pipettes in robot-frame coordinates
  • Pick up, return, discard, aspirate, dispense, and mix
  • Update and roll back PLR tip and volume trackers around commands
  • Load standard Opentrons tip racks by their official definitions
  • Generate schema-valid definitions for other PLR tip racks
  • Stop the active run using the current run-action API, with legacy fallbacks
  • List connected Opentrons modules
  • Reject unreachable, non-finite, and negative-Z movements locally

Differences from the legacy backend

  • Uses a plain device class instead of the legacy backend hierarchy
  • Exposes real left/right pipette objects instead of mount dictionaries
  • Owns its HTTP transport instead of using the global ot_api client
  • Uses current fixed-trash and run-stop payloads
  • Preserves official tip-rack identities for tip-length calibration
  • Rolls back PLR tracker changes when commands fail
  • Rejects multi-channel operations instead of tracking an eight-channel operation as one tip and one well

Documentation

Adds a runnable tutorial at:

docs/user_guide/opentrons/ot2/hello-world.ipynb

The notebook covers calibration, networking, deck setup, pipette discovery, tip handling, mixing, transfer, disposal, homing, and teardown.

Validation

  • OT-2, HTTP, deck, and geometry tests: 24 passed
  • Ruff
  • Mypy
  • Sphinx warning-as-error build
  • Notebook validation and code-cell parsing
  • Generated tip-rack definition validated against historical and current Opentrons labware schema v2
  • Physical OT-2 hardware test

Current limitations

  • Multi-channel liquid operations are not implemented
  • Custom tip racks may require measured offsets and use nominal tip geometry
  • Opentrons per-labware position-check offsets are not automatically applied to liquid labware addressed through PLR coordinates
  • Opentrons resource definitions currently require internet access on first use

Hardware status

This driver has not yet been tested on physical hardware. setup() logs an explicit warning until a staged single-channel hardware test has 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.

1 participant