Repository navigation
Correct object tracking control computation - #572
harishthakur52 wants to merge 1 commit into
Conversation
thias15
left a comment
There was a problem hiding this comment.
Looks good. The detections are already in camera-image pixels, so steering from the image size is right, and setting the busy flag early stops frames from piling up.
One small thing: the drawing block still force-unwraps res!. res is nil when there's no detector, which happens with #570 when a model fails to load, so turning on auto mode would crash. for item in res ?? [] covers it.
There was a problem hiding this comment.
🟡 Changes recommended
With WebRTC active, every camera sample is enqueued on the shared queue before the busy-flag check, so the flag does not bound queued work. During slow inference, capture jobs accumulate and retain camera buffers, delaying subsequent inference and potentially causing tracking control to lag behind the target.
1 open issue
What changed in this PR
This PR corrects iOS person-following controls by using camera coordinates and filtering low-confidence detections.
Changes:
- Compute steering using camera image dimensions.
- Filter tracking targets by confidence and mark inference busy before queueing.
- Include the final detection in non-maximum suppression.
| File | Description |
|---|---|
| robot/ios/OpenBot/OpenBot/tflite/Detector.swift | Fixes the suppression loop’s final-detection omission. |
| robot/ios/OpenBot/OpenBot/Controllers/ObjectTracking/ObjectTrackingFragment.swift | Updates steering coordinates, confidence filtering, and inference queue gating. |
Review effort: Balanced
| /// Mark busy before queueing so frames do not pile up | ||
| isInferenceQueueBusy = true |

Issue
While testing person-following on iOS, the robot circled with a person in frame and moved with no one in frame.
Fixes