Skip to content

FURLabMsgpackUtil

Bidirectional FJsonObject <-> msgpack helpers (Epic's msgpack-cxx in

clmdep_msgpack). All JSON numbers pack as float64 — round-trip precision matters for policies that mirror state from MJ. Numerical arrays (qpos / qvel / ctrl / sensors) pack as msgpack arrays of float64, not bin: Python's msgpack.unpackb decodes bin as bytes (caller would need np.frombuffer), arrays decode straight to list[float]. bin is reserved for genuinely raw payloads (handshake mjb blob, camera frame bytes) — the __b64__ key suffix marks those on the JSON side so PackJsonObject re-emits as msgpack bin.

Attribute Value
Kind Class

Functions

Public Functions

General

Function Returns Description
PackJsonObject() void Pack an FJsonObject into a binary msgpack buffer. Caller owns OutBuf.
UnpackToJsonObject() bool Unpack a binary msgpack buffer into an FJsonObject. Returns false on
SetBinaryField() void Pack-and-set a binary blob under a JSON object's field. Stores as
PackJsonObject

Pack an FJsonObject into a binary msgpack buffer. Caller owns OutBuf.

  • Signature: PackJsonObject(const TSharedPtr<FJsonObject>& Object, TArray<uint8>& OutBuf)
UnpackToJsonObject

Unpack a binary msgpack buffer into an FJsonObject. Returns false on

  • Signature: UnpackToJsonObject(const uint8* Data, int32 Size, TSharedPtr<FJsonObject>& OutObject)
  • Returns: bool
SetBinaryField

Pack-and-set a binary blob under a JSON object's field. Stores as

  • Signature: SetBinaryField(TSharedPtr<FJsonObject>& Obj, const FString& Field, const uint8* Data, int32 Size)