Skip to content

Commit 9da1bd2

Browse files
Jepson2kclaude
andcommitted
thread camera_spec through tool registry
waldoctl's ToolSpec now carries an optional camera_spec (default camera attached to a tool) plus a user-tweakable ToolRuntimeSettings override layer. ToolConfig grows a matching optional camera_spec field and _build_tools passes it into each tool constructor; tools that omit it behave as before (effective_camera_device returns None unless the user sets a runtime override). Lets the frontend stream a tool-mounted camera feed only when the active tool has one configured, and lets the user remap the device per session (e.g. virtual /dev/videoN for AI-annotation pipelines) without reinstalling the backend. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 15f02ca commit 9da1bd2

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

parol6/robot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ def _build_tools() -> _ToolsCollection:
473473
meshes=cfg.meshes,
474474
motions=cfg.motions,
475475
variants=cfg.variants,
476+
camera_spec=cfg.camera_spec,
476477
)
477478

478479
if isinstance(cfg, PneumaticGripperConfig):

parol6/tools.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import numpy as np
1818
from pinokin import se3_from_trans
1919
from waldoctl import (
20+
CameraSpec,
2021
LinearMotion,
2122
MeshRole,
2223
MeshSpec,
@@ -77,6 +78,11 @@ class ToolConfig:
7778
meshes: tuple[MeshSpec, ...] = ()
7879
motions: tuple[PartMotion, ...] = ()
7980
variants: tuple[ToolVariant, ...] = ()
81+
camera_spec: "CameraSpec | None" = None
82+
"""Optional camera attached to this tool. Wired through ``_build_tools``
83+
into the live ``ToolSpec`` so the frontend can stream the feed when this
84+
tool is active. The user can override the device per session via the
85+
tool's ``runtime_settings.camera_device``."""
8086

8187
def populate_status(self, hw: ControllerState, out: ToolStatus) -> None:
8288
"""Fill *out* from hardware state. Override in subclasses."""

0 commit comments

Comments
 (0)