Skip to content

v1: Brooks PF400: discover configuration and kinematics from the controller#1073

Draft
BioCam wants to merge 5 commits into
PyLabRobot:v1b1from
BioCam:add-preciseflex-device-discovery
Draft

v1: Brooks PF400: discover configuration and kinematics from the controller#1073
BioCam wants to merge 5 commits into
PyLabRobot:v1b1from
BioCam:add-preciseflex-device-discovery

Conversation

@BioCam
Copy link
Copy Markdown
Collaborator

@BioCam BioCam commented Jun 4, 2026

Draft. Makes the v1b1 pylabrobot.brooks PreciseFlex 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 named DataID enum (data_ids.py), exposed as configuration plus per-field request_* 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_class are 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 -2805 cause), 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:

  • DataID enum in its own module.
  • Software tracker + model scope gate + contribution prompt.
  • Tests in precise_flex_tests.py.

Follow-up PRs (out of scope here):

  • Gripper-tooling split: separate robot link lengths from gripper tooling (GripperParams), grip-center poses, z_offset <= 0 guard, and rail-orientation handling (16050[4]).
  • PreciseFlex series setup docs page.

@BioCam BioCam force-pushed the add-preciseflex-device-discovery branch from b103151 to 10f36b5 Compare June 5, 2026 09:11
BioCam and others added 5 commits June 6, 2026 13:34
…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>
@BioCam BioCam force-pushed the add-preciseflex-device-discovery branch from 78c5aef to d196f64 Compare June 6, 2026 12:44
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