v1: Brooks PF400: discover configuration and kinematics from the controller#1073
Draft
BioCam wants to merge 5 commits into
Draft
v1: Brooks PF400: discover configuration and kinematics from the controller#1073BioCam wants to merge 5 commits into
BioCam wants to merge 5 commits into
Conversation
b103151 to
10f36b5
Compare
…roller WIP (draft). Reads what the controller already stores instead of hardcoding it: PreciseFlexConfiguration (identity, axes, soft/hard limits, motion envelope) via a named DataID enum, device-read link lengths (16050) and tool transform (16051), derived has_rail / is_dual_gripper / reach_class, and a joint-limit working-envelope sweep. The freedrive and gripper-limit fixes now read from the cached config. Builds on PyLabRobot#1072. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pure move of the parameter-database DataID enum into pylabrobot/brooks/data_ids.py; precise_flex.py imports it. No behaviour change; gives one place to add more IDs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…te, contribution prompt Adds pylabrobot/brooks/confirmed_firmware_versions.py: the supported robot models for the client-side kinematics, the validated full software stacks (model + GPL + TCS + loaded-module set, build dates stripped), a capability -> required-module map, and a suggest_entry() that formats a ready-to-paste ConfirmedFirmware literal. _on_setup assesses the discovered stack: it warns on an unsupported model or a missing TCS module (naming the project to obtain from Brooks - the usual -2805 cause), and logs an info-level prompt to contribute an untested-but-working stack. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- recover_axes_within_limits(): single-axis MoveOneAxis back toward the nearest soft limit, in a safe order (gripper, base, shoulder, elbow) and capped to small excursions; wrist and rail excluded (clearance-aware wrist recovery is a TODO). - Setup gains recover_out_of_range_at_setup (default on): logs every out-of-range axis, recovers the recoverable ones, otherwise raises -1012 with recovery steps, so a dead arm never connects silently. - _axes_outside_soft_limits / _assert_within_soft_limits give commanded moves a clear client-side error instead of a bare -1012. - Relocate required-TCS-module tracking to tcs_modules.py; split _on_setup into named helpers; rename request_kinematics -> request_kinematic_parameters. - Type axis identity as Axis at the brooks layer, tighten Optional/Literal annotations, and add a recovery unit test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add ROBOT_HOMED (DataID 2800) and _is_robot_homed(). - _handle_out_of_range_axes now returns early (with a warning) when the robot is not homed: an unhomed incremental axis reads a meaningless ~0 (a false-positive out-of-range), and the controller blocks the single-axis recovery move with -1021 anyway, so the check waits for homing instead of raising or stalling at setup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
78c5aef to
d196f64
Compare
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.
Draft. Makes the v1b1
pylabrobot.brooksPreciseFlex driver configuration-agnostic by reading what the controller already stores instead of hardcoding it. Builds on #1072. Verified on a physical PreciseFlex 400.Device discovery.
PreciseFlexConfiguration(identity, axes, soft/hard limits, motion envelope) is read once at setup via a namedDataIDenum (data_ids.py), exposed asconfigurationplus per-fieldrequest_*accessors.Device-read kinematics. Link lengths come from the controller's calibration (
16050), so the driver is correct for any 400 variant (standard l1+l2 ≈ 435 vs extended ≈ 591) instead of assuming one.has_rail/is_dual_gripper/reach_classare derived from the device.Software tracking + scope (
confirmed_firmware_versions.py). At setup the driver checks the discovered model, GPL/TCS versions, and the full loaded-module set: it warns on an unsupported model (the client-side kinematics is PreciseFlex 400 only) or a missing TCS module (naming the project to obtain from Brooks — the usual-2805cause), and logs an info-level prompt to contribute an untested-but-working stack.Working envelope is computed from the discovered joint limits, not an assumed full extension.
Remaining in this PR:
DataIDenum in its own module.precise_flex_tests.py.Follow-up PRs (out of scope here):
GripperParams), grip-center poses,z_offset <= 0guard, and rail-orientation handling (16050[4]).