Skip to content

Add arms module with Arm/GripperArm hierarchy, Brooks and iSWAP backends#957

Merged
rickwierenga merged 20 commits intov1b1from
arms-module
Mar 27, 2026
Merged

Add arms module with Arm/GripperArm hierarchy, Brooks and iSWAP backends#957
rickwierenga merged 20 commits intov1b1from
arms-module

Conversation

@rickwierenga
Copy link
Copy Markdown
Member

Summary

  • Add pylabrobot/arms/ module with Arm, OrientableArm, JointArm device classes and GripperArmBackend, _BaseArmBackend, CanFreedrive backend hierarchy
  • Add pylabrobot/brooks/ vendor module with PreciseFlexBackend implementing JointGripperArmBackend
  • Add pylabrobot/hamilton/liquid_handlers/star/core.py (CoreGripper) and iswap.py (iSWAP) backends
  • Legacy PreciseFlexBackend delegates to new Brooks module
  • Legacy STAR_backend grip/iSWAP operations delegate to new backends
  • CanGrip mixin separates gripper-specific methods from base arm operations
  • Uses backend_params pattern for vendor-specific parameters

Cherry-picked from capability-architecture branch (commits c4a1dc69c, b91036bb0).

Test plan

  • All 23 arm tests pass
  • All imports verified (arms, brooks, hamilton core/iswap)
  • Pre-commit hooks pass (ruff format, ruff check, typos)
  • CI tests pass

🤖 Generated with Claude Code

@rickwierenga rickwierenga changed the base branch from main to v1b1 March 23, 2026 21:47
@rickwierenga rickwierenga force-pushed the arms-module branch 3 times, most recently from 0881288 to f65f3cf Compare March 27, 2026 01:35
rickwierenga and others added 11 commits March 26, 2026 18:36
Make PreciseFlexBackend comply with JointArmBackend interface:
- Inherit from JointArmBackend instead of DeviceBackend
- Implement all interface methods (pick_up/drop/move for both joint and cartesian)
- Move PF-specific params (access, speed, finger_speed, grasp_force) into backend_params dataclasses
- Remove pick_up_resource/drop_resource/move_to (inlined into interface methods)
- Make set_speed/get_speed private
- Remove resource_width from drop methods across all backends
- Park delegates to move_to_safe

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Split _BaseArmBackend (halt, park) from gripper-specific methods
- Add CanGrip mixin for open_gripper/close_gripper/is_gripper_closed
- Rename ArmBackend → GripperArmBackend
- Rename OrientableArmBackend → OrientableGripperArmBackend
- Rename JointArmBackend → JointGripperArmBackend
- Rename ArticulatedArmBackend → ArticulatedGripperArmBackend
- resource_width only appears on backends that CanGrip
- Move _resolve_direction to orientable_arm.py

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The inline error codes dict was accidentally trimmed to ~20 entries.
Import the complete 1809-line error_codes.py instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rail station management (_get_rail_position, _set_rail_position,
_move_rail) is private. Public API: move_rail(position) and
rail_position field on PickUpParams, DropParams, MoveToLocationParams.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ArmPosition → GripperLocation, PreciseFlexCartesianCoords →
PreciseFlexGripperLocation, get_cartesian_position →
get_gripper_location. Legacy API unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…aseArm

- ElbowOrientation is now Literal["right", "left"] instead of Enum
- Rename conversion helpers to _convert_orientation_str_to_int (non-optional)
  and _convert_orientation_int_to_str
- Move get_gripper_location from GripperArmBackend to _BaseArmBackend so all
  arm backends expose it; add delegation in _BaseArm
- Remove redundant get_gripper_location override from JointArm — it was just
  delegating to self.backend, which _BaseArm already does identically
- Legacy adapter updated to convert between enum .value and string literals

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rickwierenga rickwierenga force-pushed the arms-module branch 4 times, most recently from a5002c0 to 2e220e9 Compare March 27, 2026 03:06
rickwierenga and others added 6 commits March 26, 2026 20:07
…hitecture doc

- _BaseArmBackend extends CapabilityBackend (not DeviceBackend)
- _BaseArm extends Capability (not Device)
- Added get_gripper_location stubs to iSWAP and CoreGripper
- Removed unused Device import from arm.py
- Added architecture.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PreciseFlexDriver: Socket I/O, send_command, device lifecycle
  (setup/stop, power, attach/detach, home)
PreciseFlexArmBackend: protocol translation for all arm operations
  (pick/drop/move, gripper, joints, freedrive, motion profiles)
PreciseFlex400: Device with OrientableArm capability

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Frontend now mirrors backend:
  _BaseArm          → _BaseArmBackend (halt, park, get_gripper_location)
  GripperArm        → GripperArmBackend (+ open/close_gripper, pick_up/drop/move)
  OrientableArm     → OrientableGripperArmBackend (+ direction)

Gripper methods moved from _BaseArm to GripperArm. OrientableArm
extends GripperArm. Fixes mypy attr-defined errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
rickwierenga and others added 2 commits March 26, 2026 22:06
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rickwierenga rickwierenga merged commit ed710c6 into v1b1 Mar 27, 2026
3 of 19 checks passed
@rickwierenga rickwierenga deleted the arms-module branch March 27, 2026 05:23
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