Skip to content

Update arm resource state after pickup#1162

Open
j0nch wants to merge 2 commits into
PyLabRobot:v1b1from
j0nch:fix/realtime-arm-resource-state
Open

Update arm resource state after pickup#1162
j0nch wants to merge 2 commits into
PyLabRobot:v1b1from
j0nch:fix/realtime-arm-resource-state

Conversation

@j0nch

@j0nch j0nch commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

This updates arm resource moves so the resource model reflects pickup/drop boundaries in real time instead of waiting for the full move to complete.

For both the new arm capability stack and the legacy LiquidHandler resource-move path:

  • after a successful physical pickup, the resource is unassigned from its source location
  • after a successful physical drop, the resource is assigned to the destination
  • drop placement math uses resource rotation captured at pickup time, so it does not depend on the source parent still being present

This allows downstream orchestration to safely react as soon as a source location is actually free. For example, a workflow can begin staging another resource to a handoff location once an arm has picked up the current resource, rather than waiting for the full pickup + travel + drop sequence to complete.

Legacy STAR/iSWAP release-width fix

While testing the legacy STAR/iSWAP path, we found one important detail: after early unassignment, legacy STARBackend.drop_resource() could no longer reliably recompute the release width from resource.get_absolute_size_x/y(), because the resource no longer had its source/carrier rotation context.

This branch now captures resource_width_at_pickup in the legacy ResourcePickup / ResourceDrop flow and uses that captured width for the iSWAP drop release width. This matches the new capability path, which already carries held-resource width state.

Without this, some rotated/source-context-dependent moves could release at a width derived from the wrong resource axis instead of the actual gripped width.

Tests

  • Added capability arm tests covering source unassignment after pickup and destination assignment after drop.
  • Added legacy LiquidHandler tests covering source unassignment after pickup, destination assignment after drop, and preservation of pickup-time release width after source unassignment.

Locally run:

python3 -m py_compile \
  pylabrobot/capabilities/arms/arm.py \
  pylabrobot/capabilities/arms/articulated_arm.py \
  pylabrobot/capabilities/arms/orientable_arm.py \
  pylabrobot/legacy/liquid_handling/standard.py \
  pylabrobot/legacy/liquid_handling/liquid_handler.py \
  pylabrobot/legacy/liquid_handling/backends/hamilton/STAR_backend.py \
  pylabrobot/legacy/liquid_handling/liquid_handler_tests.py

python3 -m unittest pylabrobot.capabilities.arms.arm_tests
python3 -m unittest pylabrobot.legacy.liquid_handling.backends.tecan.EVO_tests

Also ran the targeted legacy TestLiquidHandlerSerializeState suite locally; all targeted tests passed.

Hardware validation

Validated on a STAR/iSWAP workcell using the legacy LiquidHandler path:

  • source locations became available at pickup as expected
  • destination assignment/orientation remained correct after drop
  • iSWAP release width remained correct after the resource_width_at_pickup fix
  • an orchestration test was able to safely overlap downstream work using the earlier source-free signal while preserving single-arm-operation and single-handoff-location occupancy invariants

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