add a depth output

Publish sl::MEASURE::DEPTH as float32 [H, W] millimetres on every frame that
carries image_bgr, with the intrinsics, frame_id and timestamps the other
outputs carry.

The map is copied out rather than published in place: sl::Mat rows can be
padded, so the buffer is not necessarily H * W floats. inf and nan are cleared
to 0 in the same pass, matching the reference driver — a hole is meaningful and
a consumer cannot back-project a non-finite value.

Consumers that need 3D can now back-project depth with the published
intrinsics instead of receiving a point cloud.

Also drops the stale objects entry from the dataflow outputs, missed when
detection was removed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7g2cBJ5e3r15ZbJ9WZn8c
This commit is contained in:
cesar
2026-09-08 09:17:36 -03:00
co-authored by Claude Opus 5
parent dc7f9f5501
commit 15134dc12e
6 changed files with 64 additions and 3 deletions
+5
View File
@@ -119,6 +119,7 @@ bool Camera::grab() {
return false;
}
zed_.retrieveImage(image_mat_, sl::VIEW::LEFT);
zed_.retrieveMeasure(depth_mat_, sl::MEASURE::DEPTH);
zed_.retrieveMeasure(point_cloud_mat_, sl::MEASURE::XYZRGBA);
return true;
}
@@ -149,6 +150,10 @@ sl::Mat& Camera::image() {
return image_mat_;
}
sl::Mat& Camera::depth() {
return depth_mat_;
}
sl::Mat& Camera::point_cloud() {
return point_cloud_mat_;
}