realsense: find Alfred's mast D455 on the USB bus - #4014
Conversation
The hardcoded serial only held for one robot. With the rear D435i also plugged in librealsense hands back whichever it enumerated first, so the mast camera is now pinned by USB product id instead, read off sysfs on Linux and ioreg on macOS without opening the device.
The PR is not safe to merge until Alfred rejects an absent or ambiguous D455 instead of starting with unrestricted RealSense selection. Findings
|
|
|
||
| _alfred_hardware = autoconnect( | ||
| RealSenseCamera.blueprint( | ||
| serial_number=find_serial("D455"), |
There was a problem hiding this comment.
If D455 discovery finds no unique mast camera, find_serial("D455") returns None, but this forwards that value to the camera configuration instead of stopping startup. The capture code only calls enable_device_from_serial when a serial is present, so the camera starts without selecting the D455 and may use the attached rear D435i instead.
Artifacts
- Authored executable validation parses the Alfred blueprint and Rust capture code and executes the production Python configuration handoff field, showing the null-versus-serial selector behavior.
- Executed `python trex-artifacts/realsense-serial-pinning-check.py null` in `/home/user/repo` with exit code 0; it captured explicit null handoff and the unpinned capture result.
- Executed `python trex-artifacts/realsense-serial-pinning-check.py D455-SERIAL-123` in `/home/user/repo` with exit code 0; it captured the serial handoff and serial-pinned capture result.
|
|
||
| _alfred_hardware = autoconnect( | ||
| RealSenseCamera.blueprint( | ||
| serial_number=find_serial("D455"), |
There was a problem hiding this comment.
Missing Serial Selects Wrong Camera
When no D455 is detected or multiple D455s are attached, find_serial("D455") returns None. RealSenseCamera treats that value as no serial restriction rather than refusing to start. Because Alfred's rear D435i remains attached, librealsense can select an unintended camera, causing Alfred to publish data from the wrong physical viewpoint.
A None serial is not a restriction, so with the rear D435i attached a failed D455 lookup silently opened it instead.
❌ 7 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Replaces Alfred's hardcoded D455 serial