Repository navigation
rig: the LED backlight as a connector (gateway, launcher, converter, Studio mapping, tests) - #297
Open
taylorlm88 wants to merge 2 commits into
Open
taylorlm88 wants to merge 2 commits into
taylorlm88 wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Summary
Wires the LED backlight controller into the arena rig the way BIAS is wired, so a protocol’s backlight plugin (declared in the YAML as matlab: class: "LEDControllerPlugin") runs from the Studio through the backlight node instead of being skipped. The node itself,
rig_nodes.backlight_node, comes from reiserlab/rig-nodes#11.rig/nodes/bridge_node.py):/backlight/cmd|reply|statusconstants. Abacklightentry inCONNECTOR_TOPICS(relay, replies routed to the asking tab, run-log connector events,hello_ackadvertises it). The three topics are added to the bag and to the run's openingconnector_status.rig/nodes/rig.py):--backlight,--backlight-simand--backlight-args, following BIAS.--backlight-simfills in--port socket://127.0.0.1:5020, and--backlightwith no port exits 2 before anything starts.rig/nodes/mcap_convert.py):/backlight/reply|status→{"type":"connector","src":"backlight",…}events.arena_studio.html):connectorPluginNames()mapsLEDControllerPlugin, or a plugin namedbacklight, to thebacklightconnector.rig/pixi.toml:backlight-node,backlight-cmdandbacklight-simtasks.test_gateway_registration.py: five backlight checks.studio_emulator.py --backlight-cmds: six commands as the Studio writes them.test_ros2_poc.py: simulator and node on the graph. Checks commands and via=ws replies one to one with the plugin name, status lines,/backlight/*in the bag, and that the simulator received exactly the Studio's lines in order.rig/README.md: a Backlight paragraph, commands and the tasks row.Depends on: a rig-nodes release containing reiserlab/rig-nodes#11, then a commit here bumping
rig/pixi.toml'srig_nodespin to it. Until then the backlight checks skip with an info line (the installed 0.4.0 has no backlight node). Opened as a draft for that reason.Open questions
RED 5 0, neverRED 5.plugin-registry.jsgivespanel_numa default of 0 ("Panel # (0=all)"), and the Studio writes non-empty defaults into new cards. So everysetRedLEDPowercard is{power: 5, panel_num: 0}.pattern's default''is empty, so it isn't written.criticalfor connector commands. A failed connector command is proceed-and-skip, for BIAS and ScanImage today and the backlight with this PR. MATLAB aborts the run when a critical plugin fails, so a backlight that stops working mid-run would no longer stop the experiment. Is proceed-and-skip the intended policy for every connector?criticalfield has no effect in the Studio (a consequence of L2).--backlightstart without the node when the installed rig-nodes lacks it? It currently prints one line and starts the rest of the rig, following the host-monitor pattern. The alternative is to refuse to start for a device the operator asked for by name.Tier
next candidate (changes the Studio)
Release notes
Studio
setIRLEDPower,setRedLEDPower,turnOnLED, …) go through the rig's backlight node instead of being skipped. Start the rig withpixi run rig -- --backlight --backlight-args "--port COM6", or try it without hardware using--backlight --backlight-sim.Test plan
pixi run testpixi run -e dev test-gateway: 10/10, macOS. Thedevenvironment was pointed at the rig-nodes branch; that change is not committed.pixi run -e dev test(rig): 67/67, macOS. Includes the five backlight checks: Studio-path commands, via=ws replies with the plugin name, status lines,/backlight/*in the bag, and exact lines at the simulator in order. An earlier run had five timing/BIAS-video failures that didn't recur. The harness's tolerances are tuned for rig PCs.arena_studio.htmlpass. Separately checked:connectorPluginNames()mapsLEDControllerPluginandbacklightto the backlight connector, and BIAS is unchanged.mainmerged in after rig: the ROS distribution is one switch — jazzy/lyrical features in rig/pixi.toml (rigs' environments unchanged) #294;rig/pixi.toml's[workspace.build-variants]now comes frommain, so nothing extra is needed here.pixi run rig -- --backlight --backlight-sim. Not done.