Skip to main content
STUB DOCUMENT: This page is intentionally minimal and will be expanded with deeper technical details in a future update.
When a single edge worker runs detection models on frames from multiple cameras (each represented by a different digital twin), detection results must be published back to the correct twin’s Zenoh channel.

The problem

By default, DataBus publishes to the twin it was constructed with. In a multi-camera worker, all detections would land on a single twin’s channel regardless of which camera produced the frame.

Solution: twin_uuid routing

Pass twin_uuid=ctx.twin_uuid to model.predict() to route detections to the originating twin.
Each hook’s ctx.twin_uuid is set from the decorator registration, so model.predict() publishes detections to cw/{twin_uuid}/data/detections/{runtime} for the correct twin. ctx.sensor_name is populated from the observed Zenoh key (e.g. color_camera), so a single handler can disambiguate multi-sensor twins at runtime.
Omitting sensor= subscribes to the twin’s frames/** wildcard, matching any camera the driver actually publishes. Pin sensor="<name>" only when you need to target one specific sensor on a multi-camera twin (the name must match the twin asset’s sensor id — typically color_camera, depth_camera, etc.).

Cross-twin synchronized hooks

For stereo vision or cross-camera fusion, use @cw.on_synchronized with twin_channels to synchronize frames from different twins:
The single-twin @cw.on_synchronized(twin_uuid, channels) API continues to work unchanged.

Key API additions