feat(posture): idle 폴링을 msp → mim 로 전환 — 펌웨어 신규 IMU FIFO 명령 활용
## 배경 6/30 msp 전환으로 piezo 무음은 확보했지만, 1샘플/폴링 이라 WalkingDetector 1.5초 window 를 채우려면 200ms 주기 폴링 필요 → BLE 왕복 5배 트래픽 + 나이퀴스트 aliasing 위험 → walking 감지 실제로 어려움. 7/03 펌웨어 신규 명령 `mim?` 배포: - 요청: mim? [tag 4B][space 1B][crc 2B] = 7B - 응답: rim: [tag 4B][total 2B][sample 12B × 15][crc 2B] = 188B - 15 sample (300ms 시계열) 무음 반환 - 응답 프레임은 mtb? 의 rim: 와 동일 스키마 → 파서 재사용 ## 변경 - BleManager.sendImuFifoQuery() 추가 — mim? 명령 전송 * imuCollector.reset() 선행 (frame buffer 초기화) * 기존 sendImuQuery(msp) 는 유지 (watchdog heartbeat 계속 사용) * sendRaw 디버그 라벨에 "mim" 추가 - PiezoMonitoringView idle 폴러 sendImuQuery → sendImuFifoQuery - GreenZoneConstants.posturePollIntervalMs 200 → 1000ms * mim 1회에 300ms 시계열 얻으므로 1초 주기로도 walking window 충분히 채움 * BLE 왕복 5배 감소 → 배터리 유리 ## 결과 (예상) - Idle 도넛 화면에서 walking 감지 정상 작동 - BLE 트래픽·전력 감소 - 응답 파서 (imuCollector.parseRim + onComplete) 그대로 재사용, 로직 무변경 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -64,12 +64,15 @@ object GreenZoneConstants {
|
||||
@Volatile var postureAccMagMax: Float = 1.2f
|
||||
|
||||
/**
|
||||
* Posture polling 간격 (ms). PiezoMonitoring 에서 msp 보내는 주기.
|
||||
* 6/30 변경: mtb (1Hz × 15sample) → msp (5Hz × 1sample) 로 전환. piezo burst 가청음 제거.
|
||||
* Walking detector 의 1.5초 window 안에 7-8 sample 확보 위해 200ms 주기.
|
||||
* Posture polling 간격 (ms). PiezoMonitoring idle 폴링 주기.
|
||||
* 이력:
|
||||
* 6/30 : mtb (1Hz × 15sample) → msp (5Hz × 1sample) — piezo 무음 확보, 주기 200ms
|
||||
* (walking window 1.5초 안에 7-8 샘플 확보용)
|
||||
* 7/03 : msp → mim (1Hz × 15sample, 무음) — piezo 무음 유지 + 시계열 15샘플 확보.
|
||||
* 단일 폴링당 300ms 시계열 얻으므로 주기 1000ms 로 완화 (BLE 왕복 5배 감소).
|
||||
* dev 모드에서 조정 가능.
|
||||
*/
|
||||
@Volatile var posturePollIntervalMs: Long = 200L
|
||||
@Volatile var posturePollIntervalMs: Long = 1000L
|
||||
|
||||
// ── Walking detector 임계값 (flowchart 4-2 / 5-2) ─────────────────
|
||||
/** Walking 인정 최소 pitch (deg). |pitch| > 이 값 이라야 walking 후보. */
|
||||
|
||||
Reference in New Issue
Block a user