Nothing in a dataflow carries fx, fy, cx and cy except the camera, and every pixel of a depth map needs them to become a 3D point. The node now accepts them so whatever computes that next has them to hand. They are read from two places because dora-zed publishes them twice: the camera_info message, and the metadata of every frame. The per-frame copy is not redundant -- camera_info goes out once per camera session, so a viewer started after the camera would otherwise never see it, and reading frame metadata means wiring the input is optional even for a camera that publishes it. A nine-element row-major K is accepted alongside the compact [fx, fy, cx, cy], since that is how ROS spells the same model in sensor_msgs/CameraInfo. The model is drawn under the caption rather than only stored. A depth map read through the wrong intrinsics looks entirely plausible, and this is where that becomes visible. as_float32 moves to a payload module: camera_info arrives as a raw byte slice for the same reason the depth map does, and the reinterpretation is now shared rather than written twice. Verified with dora-cli 1.0.1: validate passes with four contracts injected on each side, the dataflow runs to a clean exit, and a composed frame was rendered and inspected with the model drawn on it.
64 lines
2.1 KiB
YAML
64 lines
2.1 KiB
YAML
# Manifest for the example source node.
|
|
#
|
|
# Its reason to exist is as much mechanical as documentary: `dora validate`
|
|
# matches a node manifest to a `path:` node by entrypoint, and without a
|
|
# manifest here the repository-root dora-node.yml -- whose entrypoint is
|
|
# `dora-image-view` -- gets tried against `examples/source.py`, does not match,
|
|
# and warns. Under `strict_types: true` that warning fails the run.
|
|
#
|
|
# Declaring the types here rather than as `output_types:` in dataflow.yml is
|
|
# what makes them checked: an inline annotation shadows the manifest, so the
|
|
# manifest would be injected but never compared against dora-image-view's.
|
|
apiVersion: 1
|
|
name: source
|
|
namespace: liria
|
|
description: Synthetic image, depth, camera_info, bbox and text source for the dora-image-view example
|
|
categories: [debug]
|
|
keywords: [example, test, synthetic]
|
|
|
|
runtime: python
|
|
entrypoint: source.py
|
|
build: pip install .
|
|
dora: ">=1.0"
|
|
|
|
inputs:
|
|
tick:
|
|
required: true
|
|
description: Timer tick; one frame is emitted per tick.
|
|
|
|
outputs:
|
|
image:
|
|
type: std/core/v1/UInt8
|
|
description: >-
|
|
Animated bgr8 frame as a flat UInt8 buffer, with metadata
|
|
{width, height, encoding}.
|
|
bbox:
|
|
description: >-
|
|
The box around the moving square: an Arrow struct {bbox, conf, labels}
|
|
with metadata {format: xyxy}. Untyped to match the dora-image-view input.
|
|
text:
|
|
type: std/core/v1/String
|
|
description: A fixed caption.
|
|
camera_info:
|
|
type: std/core/v1/Float32
|
|
description: >-
|
|
[fx, fy, cx, cy] for the frames above. Published once, on the first tick,
|
|
the way a real camera publishes it once per session.
|
|
depth:
|
|
type: std/core/v1/Float32
|
|
description: >-
|
|
Depth of the same scene in millimetres, [height, width]: a flat wall with
|
|
the square standing in front of it.
|
|
|
|
|
|
env:
|
|
SOURCE_WIDTH:
|
|
type: int
|
|
description: Frame width in pixels. Defaults to 640.
|
|
SOURCE_HEIGHT:
|
|
type: int
|
|
description: Frame height in pixels. Defaults to 480.
|
|
SOURCE_FRAMES:
|
|
type: int
|
|
description: Stop after this many frames. 0, the default, runs until the viewer quits.
|