[Backport release/0.0.14] feat(teleop): add PICO WebXR body tracking - #4178
github-actions[bot] wants to merge 1 commit into
Conversation
(cherry picked from commit 180b252)
|
| type: Literal["body_tracking_snapshot"] | ||
| capture_time_s: _FiniteFloat | ||
| frame_id: _NonEmptyString | ||
| joints: dict[_NonEmptyString, BodyJointPose] | None |
There was a problem hiding this comment.
The WebSocket text-message handler parses and publishes every joints entry without a message-size, joint-count, or per-client rate limit. A connected client can repeatedly submit large valid snapshots, forcing synchronous allocation and validation of every pose before publication. This can exhaust CPU and memory needed for teleoperation. Limit inbound frame size and joint cardinality before parsing, and coalesce or rate-limit snapshots per client.
How this was verified: A 1.8 MB valid snapshot containing 25,000 distinct joints was accepted and retained three times by the parser used on this message path.
Artifacts
- Captured the exact temporary Python script authored for the focused body-snapshot parser check, ending with the exercised contract.
- Ran the same repro against `HEAD~1`; it cannot import the body-tracking module because the feature did not exist before the change, establishing the before side of the pair.
- Ran the authored repro against the changed code; three 25,000-entry valid joint maps were synchronously parsed and accepted, demonstrating no parser cardinality bound.
- Captured the PR diff for the body snapshot model and WebSocket text-frame dispatch path, showing the unbounded map and direct synchronous publish.
Description
Backport of #3695 to
release/0.0.14.