forums.naturalpoint.com

Discussion and Support for the OptiTrack, SmartNav and TrackIR brands by NaturalPoint

SDK 3.0 mocap frame data format

by dario.turchi » Thu Jan 18, 2018 5:19 am

Hello,
we recently switched to motive 2.0 and thus SDK 3.0.
Trying to run the python client in the sample folder of the SDK, however, I get strange results:
* parsing error leading to application crash:
Code: Select all
  File "/home/dario/Downloads/NatNetSDK/Samples/PythonClient/NatNetClient.py", line 233, in __unpackMocapData
    residual, = FloatValue.unpack( data[offset:offset+4] )
struct.error: unpack requires a bytes object of length 4

Code: Select all
  File "/home/dario/Downloads/NatNetSDK/Samples/PythonClient/NatNetClient.py", line 81, in __unpackRigidBody
    rot = Quaternion.unpack( data[offset:offset+16] )
struct.error: unpack requires a bytes object of length 16

Code: Select all
  File "/home/dario/Downloads/NatNetSDK/Samples/PythonClient/NatNetClient.py", line 78, in __unpackRigidBody
    pos = Vector3.unpack( data[offset:offset+12] )
struct.error: unpack requires a bytes object of length 12


* parsing errors (I guess) leading to "randomic" bodies IDs: with just one rigid body in the scene, before the claient crashes i get
Code: Select all
Received frame for rigid body 1
Received frame for rigid body 1064778954
Received frame for rigid body 196608
Received frame for rigid body 1188839327
Received frame for rigid body 3185192752
Received frame for rigid body 1075996262
Exception in thread Thread-1:
... [etc] ...


Are these common issues/bugs or it is just me ? Where can I find the data format for SDK 3.0 mocap frames for checking what's the issue in the parsing operations ?

Regards
Dario Turchi
dario.turchi
 
Posts: 8
Joined: Tue Aug 08, 2017 10:28 am

by steven.andrews » Thu Jan 18, 2018 2:14 pm

Hello Dario,

Thank you for bringing this to our attention. We recently became aware of some issues with the Python client that is included with the NatNet SDK. We will be working to fix this, most likely for a Motive 2.1 release.

If you need to know the format for direct depacketization, the PacketClient sample should still demonstrate how to do this correctly.

Best,
Steven
--
Steven Andrews
OptiTrack | Senior Customer Support Engineer
help.naturalpoint.com
support@optitrack.com
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
 
Posts: 437
Joined: Mon Jan 19, 2015 11:52 am

by dario.turchi » Mon Jan 22, 2018 3:45 am

I think I found the problem, line 116-117 in NatNetClinet.py :
Code: Select all
        # Skip padding inserted by the server
        offset += 4

by removing this the code seems to work. Can you confirm that the mentioned padding block has been removed ?
dario.turchi
 
Posts: 8
Joined: Tue Aug 08, 2017 10:28 am


Return to Motive