meaning of NatNetClient send_command codes

NatNet, VRPN, TrackD, and Plugins
Post Reply
baptistec
Posts: 4
Joined: Sat Mar 11, 2023 6:38 am

meaning of NatNetClient send_command codes

Post by baptistec »

Hello.
I am trying to use NatNetClient in python to check that all properties in Motive are set as I expect, but I receive nonsensical codes.
If I use for instance:
res = streaming_client.send_command("SetProperty,eSync 2,SyncOutput1Enabled,false")
Then I can successfully set on or off output1 of the eSync. The function send_command also returns the code 49, which might mean 1 in ascii. But if I simply try to read the property:
res = streaming_client.send_command("GetProperty,eSync 2,SyncOutput1Enabled")
Then I receive the code 43, which means nothing.
The same is true for other properties. For instance with:
res = streaming_client.send_command("SetProperty,eSync 2,SyncOutput1PulseDuration,14")
I can set Output1 Type to Gated internal clock, as expected from the constraints listed in the profile xml file. But the code returned is 52. If I set it to 12 it also returns 52, but if I set it to 2, then it returns 51.
So I cannot find any logic in these codes. Has anybody successfully managed to get property values through NatNetClient?
Thanks.
baptistec
Posts: 4
Joined: Sat Mar 11, 2023 6:38 am

Re: meaning of NatNetClient send_command codes

Post by baptistec »

I got in touch with Optitrack and they pointed out that the response to a "GetProperty" command is not send through the same command socket, but as a message on the input socket handled by the function __process_message (same as data frames).

Messages have the following structure: message type (3 for NAT_RESPONSE), message length, and message itself. For instance as a reply to streaming_client.send_command("GetProperty,eSync 2,SyncOutput1Enabled") I get the following response:
'\x03\x00\x04\x00true'

The number returned by streaming_client.send_command is simply the number of bytes sent through the socket (so anything else than -1 means command successfully sent).
Post Reply