feat(perception): QR code reader on CSI surround frames (Issue #233) #237

Merged
sl-jetson merged 1 commits from sl-perception/issue-233-qr-reader into main 2026-03-02 12:15:08 -05:00
Collaborator

Summary

  • Adds QRDetection.msg + QRDetectionArray.msg to saltybot_scene_msgs (data, camera, corners[8], center)
  • Pure-Python _qr_detector.py: detect_qr(bgr) wraps cv2.QRCodeDetector.detectAndDecodeMulti; deduplicate() filters by per-payload cooldown with automatic cache eviction
  • qr_reader_node.py in saltybot_perception: subscribes all four CSI streams (/camera/{front,left,rear,right}/image_raw), deduplicates with 2 s cooldown, publishes /saltybot/qr_codes at 10 Hz
  • Thread-safe pending queue (Lock) so camera callbacks and 10 Hz tick never race

Test plan

  • test/test_qr_detector.py — 16/16 pure-Python tests pass (includes real QR encode/decode via cv2.QRCodeEncoder)
  • Deploy on Jetson, verify /saltybot/qr_codes fires within 100 ms of holding a QR in front of any camera
  • Confirm 2 s cooldown suppresses re-publish of the same code

🤖 Generated with Claude Code

## Summary - Adds `QRDetection.msg` + `QRDetectionArray.msg` to `saltybot_scene_msgs` (data, camera, corners[8], center) - Pure-Python `_qr_detector.py`: `detect_qr(bgr)` wraps `cv2.QRCodeDetector.detectAndDecodeMulti`; `deduplicate()` filters by per-payload cooldown with automatic cache eviction - `qr_reader_node.py` in `saltybot_perception`: subscribes all four CSI streams (`/camera/{front,left,rear,right}/image_raw`), deduplicates with 2 s cooldown, publishes `/saltybot/qr_codes` at 10 Hz - Thread-safe pending queue (Lock) so camera callbacks and 10 Hz tick never race ## Test plan - [x] `test/test_qr_detector.py` — 16/16 pure-Python tests pass (includes real QR encode/decode via `cv2.QRCodeEncoder`) - [ ] Deploy on Jetson, verify `/saltybot/qr_codes` fires within 100 ms of holding a QR in front of any camera - [ ] Confirm 2 s cooldown suppresses re-publish of the same code 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sl-perception added 1 commit 2026-03-02 12:13:14 -05:00
Adds cv2.QRCodeDetector-based QR reader that subscribes to all four IMX219
CSI camera streams, deduplicates detections with a 2 s per-payload cooldown,
and publishes /saltybot/qr_codes (QRDetectionArray) at 10 Hz.  New
QRDetection / QRDetectionArray messages added to saltybot_scene_msgs.
16/16 pure-Python tests pass (no ROS2 required).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sl-jetson merged commit 80a049fb0e into main 2026-03-02 12:15:08 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#237
No description provided.