Skip to content

rig_nodes: bias_health (from the okey-cokey rig) + a derive hook on foxglove_json.convert - #1

Merged
mbreiser merged 1 commit into
mainfrom
feat/bias-health
Oct 28, 2026
Merged

mbreiser merged 1 commit into
mainfrom
feat/bias-health

Conversation

@mbreiser

Copy link
Copy Markdown
Contributor

Summary

Two additions to rig_nodes, both needed by webDisplayTools PR #269 (the okey-cokey camera + G6 dashboard) now that it sits on top of the extraction (#274). No version bump: ships with the next package set (README "Releasing a package set"); #269 is marked as needing rig-nodes ≥ that release.

  • rig_nodes/bias_health.py — CountRate (BIAS frame rate as the slope of frameCount over the last 2 s of status polls, restarting when the counter goes down) and bias_drops (the sum of the loss counters the Atlas10 build reports in get-status; None when it reports none). Moved verbatim from webDisplayTools rig/nodes/bias_health.py; the record (rig-software-repos-and-runners.md §3.3) already lists it as a rig-nodes file. Consumers: the arena visualization node (/viz/bias/fps_from_count, /viz/bias/drops) and the dashboard replay.
  • foxglove_json.convert(..., derive=None) — a whole-stream hook beside the per-message enrich. derive(records) receives every kept record (topic, log_ns, obj) in log order and yields NEW messages (topic, t_ns, obj, schema_name | None); a derived message may name a WELL_KNOWN_SCHEMAS entry (foxglove.CompressedImage today) instead of an inferred schema, an unknown name is refused, and the report gains derived. The arena wrapper's --stimulus mode (expected-display images, arena health, camera frames rebuilt from the browser stream) needs this; enrich maps one recorded message to one output and cannot emit topics that were never recorded.

Tests

pixi run test-pure: 40/40 (bias_health 6 checks, derive 5 checks, on top of the 29). test_device_nodes is untouched by this change (no node code).

Linear

LAB-303 (okey-cokey rig), LAB-338 (extraction follow-up).

🤖 Generated with Claude Code

…rive` hook on foxglove_json.convert

* `rig_nodes/bias_health.py` — CountRate (frame rate as the slope of the BIAS frameCount over the
  last 2 s of status polls) and bias_drops (the sum of the loss counters the Atlas10 build reports;
  None when it reports none). Moved verbatim from webDisplayTools `rig/nodes/bias_health.py`
  (PR reiserlab/webDisplayTools#269), where the arena visualization node and the dashboard replay
  import it; pure, no ROS.
* `foxglove_json.convert(..., derive=None)` — a second, whole-stream hook beside the per-message
  `enrich`: `derive(records)` gets every kept record (topic, log_ns, obj) in log order and yields
  new messages (topic, t_ns, obj, schema_name | None). A derived message may name one of
  `WELL_KNOWN_SCHEMAS` (foxglove.CompressedImage today) instead of an inferred schema; an unknown
  name is refused. The report gains `derived`. This is what the arena wrapper's `--stimulus` mode
  needs (rebuilding the expected-display images and health topics from the browser stream), and
  it could not be expressed through `enrich`, which maps one recorded message to one output.
* tests/test_pure.py: bias_health (6 checks) + derive (5 checks); 40/40.

Not a release: the version stays 0.2.1 until the next package set (README "Releasing").

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mbreiser
mbreiser merged commit 1fbf749 into main Oct 28, 2026
7 checks passed
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