Skip to content

iSWAP: transports planned from the resource model, refused when they would hit something - #1469

Closed
stefangolas wants to merge 9 commits into
PyLabRobot:mainfrom
stefangolas:star-iswap
Closed

stefangolas wants to merge 9 commits into
PyLabRobot:mainfrom
stefangolas:star-iswap

Conversation

@stefangolas

@stefangolas stefangolas commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

iSWAP: plate and lid transports planned from the resource model, refused when they would hit something

The iSWAP's plate and lid moves are planned from where resources actually are (iswap_transport.py), and every plan is checked for what it would hit before anything runs (iswap_collisions.py): the arm's parts, what it holds, and what rides the X-arm with it are swept along the plan and tested by GJK distance against the world — the deck frame for what stands still, and the arm's own frame for the channels and the 96-head that ride it. A plan that would meet something is refused with iSWAPCollisionError.

Layering (separation of concerns)

  • pylabrobot/resources/collision.py — generic, machine-agnostic: box semantics over the resource tree (solid / frame / enclosure, by how a resource holds its children), convex pieces, swept segments, GJK distance, a bounding-volume broadphase. Declared hulls (.collision.json per model) refine a resource's pieces where shipped; without one, a resource is its box.

  • hamilton/star/driver/features/iswap_transport.py / iswap_collisions.py — the iSWAP's own kinematics and judgement, beside iswap.py. The planner plans; the collision module judges; nothing here is wired into a drive path yet.

Behaviour changes

None on live firmware. Nothing here is called from a drive path — the planner and the checker are a library (see the demos), and the tests drive them directly.

Simulator only: the simulated iSWAP now answers the force-window grip close (C0 GC) by stopping the jaws at the commanded width, so the model's grip is the planned grip. Live hardware is unaffected; simulated command streams that grip change their answers, not their writes.

Notes

  • Upstream ships no .collision.json hull files, so every resource is checked as its box (conservative, with touch-leniency for box-represented resources); the sweeps-vs-model consistency test is therefore checked on bare parts.

  • Stacked on STAR: act firmware commands out in the viewer (motion playback) #1468 (shares the demo's motion-attachment API); base retargets to main once that merges.

@stefangolas

Copy link
Copy Markdown
Contributor Author

Closing this in favour of #1468: the four viewer demos (the Y ripple, the 96 head, the iSWAP, and the CO-RE gripper) have been folded into it, and its branch tree is now identical to this one. The transport planning and collision checking this PR's title and body describe are not in the branch - they were likely dropped in a rebase; if that work resurfaces it should come back as its own PR with its own description.

@stefangolas stefangolas closed this Oct 4, 2026
@stefangolas
stefangolas deleted the star-iswap branch October 4, 2026 14:28
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