Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion natnet/data_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class RigidBodyDescription(
("id_num", int),
("parent_id", int),
("pos", Vec3),
("quat", Optional[Vec4]),
("markers", Tuple[RigidBodyMarkerDescription, ...]),
),
),
Expand All @@ -75,6 +76,11 @@ def read_from_buffer(
parent_id = buffer.read_uint32()
pos = buffer.read_float32_array(3)

# Version 4.2 and higher, rigid body has quaternion
quat = (
buffer.read_float32_array(4) if protocol_version >= Version(4, 2) else None
)

# Version 3.0 and higher, rigid body marker information contained in description
if protocol_version >= Version(3):
marker_descriptions = RigidBodyMarkerDescription.read_array_from_buffer(
Expand All @@ -84,7 +90,7 @@ def read_from_buffer(
marker_descriptions = []

return RigidBodyDescription(
name, new_id, parent_id, pos, tuple(marker_descriptions)
name, new_id, parent_id, pos, quat, tuple(marker_descriptions)
)


Expand Down
Loading