Unity Adapter¶
The first Unity adapter subscribes to information-hub status frames over
WebSocket JSON. It uses no dedicated binary protocol and never touches IMU UDP
data. The component drops stale frames by frame_id and interpolates a
two-frame buffer using frame_time_ns.
Integration¶
Start the information hub first;
--status-hz 50is recommended for Unity.Copy
adapters/unity/Assets/WirelessImuMocap/MocapWebSocketClient.csinto the Unity project’sAssets/directory.Add
MocapWebSocketClientto a scene object.Set
bodyRoot, then bind shoulder, elbow, wrist, palm, and fingertip Transforms for bothleftRigandrightRig.Set
hubUrl, for examplews://127.0.0.1:8765.
The coordinate mapping is fixed:
body_rh (X forward, Y left, Z up)
-> Unity (X right, Y up, Z forward)
Unity = (-body.Y, body.Z, body.X)
This is an axis permutation plus the necessary left/right sign conversion; it
preserves the motion solver’s body_rh semantics. wear_side=left/right
selects which rig is active, and only the current wearing side is displayed.
Limits¶
This version uses
ClientWebSocketfor Unity Editor and Windows/Linux/macOS standalone. WebGL needs a browser WebSocket implementation and is not included here.Only status frames with
frame=body_rhupdate the rig.When
frame_time_nsis missing, the latest frame still renders but is not time-interpolated. That indicates the source did not complete common-timeline alignment and its synchronization status should be investigated first.