Expose iSWAP per-drive predefined-position readers + rotation drive axis accessors#1015
Merged
BioCam merged 8 commits intoPyLabRobot:mainfrom Apr 28, 2026
Conversation
…tion/wrist/gripper sections
…rientation classifiers
…dicts - Keys now match the RotationDriveOrientation / WristDriveOrientation enum names (left/front/right, right/straight/left/reverse) instead of opaque firmware indices (w1/w2/w3, t1..t4) - Link-length values now in mm (link_1_len, link_2_len), not raw increments
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends STARBackend with additional iSWAP introspection APIs to read per-drive predefined-position tables (EEPROM via R0 RA) and to query rotation-drive X/Z axes directly, while reorganizing iSWAP-related methods into per-drive sections.
Changes:
- Add EEPROM predefined-position table readers for iSWAP rotation drive (W), wrist drive (T), and gripper drive (G).
- Add rotation-drive single-axis accessors (
iswap_rotation_drive_request_x(),iswap_rotation_drive_request_z()) and simplify the composite XYZ accessor. - Reorganize iSWAP code into drive-specific sections and expose drive constants (bounds/resolution).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
ideally this would be named |
Collaborator
Author
very good point, will update immediately |
This was referenced Apr 28, 2026
Collaborator
Author
|
implemented in #1017 |
BioCam
added a commit
that referenced
this pull request
Apr 28, 2026
* naming alignment of drive predefined position requests * update stale docstring refs to renamed link-length accessors Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a crucial step in the "Tame the iSWAP" project (part 4):
accessing the positional information that the iSWAP uses for its firmware-level positioning.
Summary
Adds 5 new public methods on
STARBackendfor iSWAP introspection.Predefined-position table readers (one per drive, all read R0 RA):
request_iswap_rotation_drive_predefined_positions()request_iswap_wrist_drive_predefined_positions()request_iswap_gripper_predefined_positions()Each returns a
Dict[str, Union[int, float]]with semantic keys that mirror the existingRotationDriveOrientation/WristDriveOrientationenums:...which will be crucial for the next step 👀
Rotation drive single-axis accessors (deck coordinates, mm):
iswap_rotation_drive_request_x()iswap_rotation_drive_request_z()Lets callers grab one axis without paying for a full
Coordinatequery.Existing
iswap_rotation_drive_request_position()simplified to a 4-line composite using thex/y/zaccessors.Internal reorganization (no API impact)
Pre-existing iSWAP-related methods now grouped into three section headers:
Each section opens with the drive's exposed constants:
iswap_<drive>_drive_min_increment/_max_increment(encoder bounds)iswap_<drive>_drive_<unit>_per_increment(resolution:degfor rotation/wrist,mmfor gripper)The orientation classifiers (
request_iswap_rotation_drive_orientation,request_iswap_wrist_drive_orientation) now reference the exposed resolution constants by name instead of magic-numbering the deg/incr factor.No breaking changes
All 282 of
STARBackend's pre-existing methods preserved.Diff is purely additive (5 new methods) plus internal reorganization (existing methods moved into per-drive sections without any signature change).