← Back to Pull requests

Add dinrail-camera and dinrail-camera-components and camera-related interfaces and fake device #75

Open
unknown opened this pull request with 303 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 11, 2026 13:06 UTC
Author

This PR introduces the camera interfaces needed to migrate yarp-device-realsense2 to dinrail, together with a configurable fake camera and bidirectional YARP adapters, following #69 and #71.

The interfaces use cv::Mat for images and are provided by a separate dinrail-camera library, keeping OpenCV out of core libdinrail (mantained in src/core). They cover framegrabber controls, raw images, RGBD acquisition and RGB/depth visual parameters, with corresponding simulation interfaces.

The native dr_camera_fake devices supports both framegrabber (2D camera) and rgbd (3D/Depth cameras) modes through a single device. Images and acquisition stamps can be supplied through simulation interfaces. An optional test_pattern generates a diagnostic chart with the machine’s current local time:

<img width="640" height="480" alt="test" src="https://github.com/user-attachments/assets/7469cd8b-678f-4b12-836f-e2c0d5671734" />

~~~cxx
dinrail::Parameters config;
config.put("device", "dr_camera_fake");
config.put("mode", "framegrabber");
config.put("test_pattern", true);

dinrail::Device device;
device.open(config);

dinrail::IRGBDSensor camera = nullptr;
device.view(camera);

cv::Mat image;
camera->getRgbImage(image);
~~~

The YARP interop plugin registers adapters in both directions. The native fake is also installed as a YARP device, exposing the usual camera interfaces:

~~~cxx
yarp::os::Property config;
config.put("device", "dr_camera_fake");
config.put("mode", "framegrabber");
config.put("test_pattern", true);

yarp::dev::PolyDriver driver(config);
yarp::dev::IFrameGrabberImage
camera = nullptr;
driver.view(camera);

yarp::sig::ImageOf<yarp::sig::PixelRgb> image;
camera->getImage(image);
~~~

Image conversions preserve RGB channel order, acquisition stamps and independent output storage. They run serially without changing OpenCV’s process-wide thread configuration, and reuse buffers to avoid allocations after warmup at a fixed resolution. The adapters do not use any OpenCV or YARP_cv function in the conversion, as that would prevent avoid creating new threads or allocating dynamic memory at each conversion.

The example in examples/yarp-run-dinrail-camera-as-yarp-camera/ uses dinrail-runner to publish images through frameGrabber_nws_yarp and display them with yarpview, comparing dr_camera_fake with YARP’s fakeFrameGrabber.

Diff: 303 lines (+227 / -76) across 3 files Reviewer: traversaro Review duration: 13456m
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 303 lines diff across 3 files
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.342
Real PR Conversation Timeline
1 comments
"Review active on #75"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 40.1% (MEDIUM) · Higher = larger blast radius
40.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 21.4% · Safe to merge
21.4%