No description
- Swift 97.7%
- Python 2.3%
Three root causes addressed: 1. NSException crash: AVDepthData.converting() raises an uncatchable NSException if the target format is not in availableDepthDataTypes. Fix: check availableDepthDataTypes (as [NSNumber]) before calling converting(); fall back to native format so sampleDepth can decide. 2. Buffer overflow: sampleDepth() always read 4 bytes (Float32) even when the pixel buffer contained Float16 (2 bytes) → wrong offsets → EXC_BAD_ACCESS. Fix: branch on depthDataType, read Float32 directly or convert Float16 bits. 3. UI freeze during tab switch: liveDistances was dispatched to main thread 15×/s while SwiftUI was animating the transition. Throttled to ~3fps (every 5 processed frames). Also added distanceFrameCounter reset in stop(). Bonus: use AVCaptureDevice.DiscoverySession(.builtInLiDARDepthCamera) for strict LiDAR-only detection instead of checking formats generically. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| raspberry_pi | ||
| TeamPulse | ||
| TeamPulse.xcodeproj | ||
| TeamPulseTests | ||
| TeamPulseUITests | ||
| .gitignore | ||