Skip to content

Expose STARBackend.measure_iswap_gripper_force()#1007

Open
BioCam wants to merge 4 commits intoPyLabRobot:mainfrom
BioCam:iswap-force-feedback
Open

Expose STARBackend.measure_iswap_gripper_force()#1007
BioCam wants to merge 4 commits intoPyLabRobot:mainfrom
BioCam:iswap-force-feedback

Conversation

@BioCam
Copy link
Copy Markdown
Collaborator

@BioCam BioCam commented Apr 23, 2026

  • Adds STARBackend.measure_iswap_gripper_force() -> float, returning the force currently measured by the iSWAP gripper in Newtons.
  • Wraps the previously unexposed R0 QH firmware command.
  • Enables closed-loop grip verification, grip-slip detection, and adaptive grip-strength tuning — none of which were previously possible in PLR.

Implementation notes

  • Firmware reports force in 1/10 N units; wrapper converts to N. Effective range is 0–20.0 N, with 16.0 N being the max settable grip via gd.
  • round(x, 1) caps at the firmware's true resolution and gives clean repr() output. Matches existing PLR convention for unit conversions.
  • RuntimeError if iSWAP isn't installed, matching the existing R0 query wrappers (request_iswap_position, iswap_rotation_drive_request_y, request_iswap_initialization_status).
  • Naming follows a measure_* convention for live sensor readings, distinct from request_* used for state queries (position, init-status). New convention; happy to discuss.

Test plan

  • Static: existing CI (lint, type-check) passes.
  • On a real STAR with iSWAP installed:
    • Call with iSWAP idle / open → expect ~0 N
    • Call while gripping a plate at default strength (gw=5) → expect ~5–10 N
    • Call with gw=9 → expect closer to 16 N
    • Confirm response width matches fmt="qh###"; if firmware sends a different number of digits, adjust the format string.

Wraps the previously unexposed R0 QH firmware command to return the
force currently measured by the iSWAP gripper in Newtons. Enables
closed-loop grip verification, grip-slip detection, and adaptive
grip-strength tuning.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants