Skip to content

LAB-319 / Block S: read-only SiPM controller node (bias, enable, offsets, temperature into the run log) - #266

Draft
mbreiser wants to merge 1 commit into
claude/scanimage-frames-wrapperfrom
claude/sipm-node
Draft

mbreiser wants to merge 1 commit into
claude/scanimage-frames-wrapperfrom
claude/sipm-node

Conversation

@mbreiser

@mbreiser mbreiser commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #261 (claude/scanimage-frames-wrapper), so this diff is only the SiPM commit. Retarget to main once #261 merges.

Implements LAB-319 (split out of LAB-308, ScanImage documentation for agents, Bergamo III); uses the LAB-303 connector pattern.

Why

The SiPM detector settings (bias, enable, offsets, bandwidth, temperature) are not in ScanImage or its TIFF header. This node reads them through the vendor ThorSiPM.dll and publishes them as a connector, so they land in the run log and bag next to ScanImage and the arena.

What

  • ros2-poc/nodes/thorsipm.py — ctypes driver, no ROS. Binds only FindDevices, SelectDevice, GetParam, GetParamString, GetParamInfo, TeardownDevice (signatures from the vendor GUI's own P/Invoke metadata). No write path. CLI: scan / snapshot / watch. FakeBackend simulates the controller.
  • ros2-poc/nodes/sipm_node.py, sipm_cmd.py — /sipm/cmd, /sipm/reply, /sipm/status (1 Hz), std_msgs/String JSON like the BIAS and ScanImage connectors. Commands: ping, status, get, info, scan, disconnect, reconnect. Keeps reporting (and retrying) while the vendor GUI holds the COM port.
  • bridge_node.py, mcap_convert.py, rig.py --sipm, pixi tasks (sipm-node, sipm-cmd, sipm, test-sipm) — the sipm connector is recorded and derived like the others.

Open question the rig test answers

The GUI's Params enum gives the IDs for enable, gain, offset, bandwidth, safety, saturations and serial numbers. The DLL also names PARAM_SIPM1_BIAS, …_TEMPERATURE, …_TEMPSTATUS, but their numeric IDs aren't in the enum. Block S finds them with a read-only GetParamInfo scan and writes them to config/sipm_params.json in scanimage-2026-bergamo.

Testing

  • pixi run test-sipm: 28 / 28 (driver, node, busy port, recording) on macOS.
  • Existing suites unchanged: test-frames 39 / 39, test 54 / 54.
  • Dry run of the rig command with --fake: 16 "src":"sipm" connector events in the run log, bag closed cleanly, controller released on exit.
  • Not yet run on the real controller or on Windows. Rig procedure: rig-session-sipm-block-s.md.

🤖 Generated with Claude Code

…8/LAB-303)

The SiPM detector settings (bias, enable, offsets, bandwidth, temperature) are not in
ScanImage or its TIFF header. This adds a node that reads them through the vendor
ThorSiPM.dll and publishes them as a connector, so they land in the run log and bag.

- nodes/thorsipm.py: ctypes driver, no ROS. Binds only FindDevices, SelectDevice,
  GetParam, GetParamString, GetParamInfo and TeardownDevice (signatures from the vendor
  GUI's P/Invoke metadata); no write path. CLI: scan / snapshot / watch. FakeBackend
  simulates the controller for tests.
- nodes/sipm_node.py, nodes/sipm_cmd.py: /sipm/cmd, /sipm/reply, /sipm/status (1 Hz),
  std_msgs/String JSON like the BIAS and ScanImage connectors; commands ping, status,
  get, info, scan, disconnect, reconnect. Keeps reporting (and retrying) while the
  vendor GUI holds the COM port.
- bridge_node, mcap_convert, rig (--sipm), pixi tasks (sipm-node, sipm-cmd, sipm,
  test-sipm): the sipm connector is recorded and derived like the others.
- tests/test_sipm.py: 28 checks against the simulated controller (driver, node, busy
  port, recording). The existing suites still pass (test-frames 39/39, test 54/54).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mbreiser mbreiser changed the title LAB-308 / Block S: read-only SiPM controller node (bias, enable, offsets, temperature into the run log) LAB-319 / Block S: read-only SiPM controller node (bias, enable, offsets, temperature into the run log) Oct 19, 2026

This branch has not been deployed

No deployments
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