PacketClient packet calculation

Post Reply
jaykay
Posts: 5
Joined: Tue Oct 28, 2014 6:39 am

PacketClient packet calculation

Post by jaykay »

Hello,

i want to calculate a packet...
NatNetVersion is 2.5.
I have got 2 rigid bodies and i don't stream markers.
The first value is Message ID = 7 and then nBytes = 240.
And thats the correct value, but when i sum-up the packet i got the value 246.
Did i missed something?
I am using the NatNetSDK2.7 sample.
NaturalPoint-Dustin
Posts: 609
Joined: Tue Mar 19, 2013 5:03 pm

Re: PacketClient packet calculation

Post by NaturalPoint-Dustin »

Hello,

I will research this and get back to you shortly. I should have an answer for you by tomorrow.

Best Regards,
Dustin
Technical Support Engineer
OptiTrack | TrackIR | SmartNav
NaturalPoint-Dustin
Posts: 609
Joined: Tue Mar 19, 2013 5:03 pm

Re: PacketClient packet calculation

Post by NaturalPoint-Dustin »

Hello,

Could you provide more information on this? Also, It would be helpful to know how you came up with 246.
Dustin
Technical Support Engineer
OptiTrack | TrackIR | SmartNav
tsvilans
Posts: 3
Joined: Tue Nov 25, 2014 10:15 am
Location: London, UK
Contact:

Re: PacketClient packet calculation

Post by tsvilans »

I noticed this difference too (though in my case it was a difference of 4 bytes instead of 6). What's happening is that the numBytes value gives you the number of bytes in the payload, not the whole packet. The packet also includes the messageID (short - 2 bytes) and the numBytes (another short - 2 bytes). Where the last 2 bytes are coming from I am not sure...
---
Tom Svilans
tomsvilans.com
jaykay
Posts: 5
Joined: Tue Oct 28, 2014 6:39 am

Re: PacketClient packet calculation

Post by jaykay »

(2 MessageID)
(2 nBytes)
ID=7:
4 frameNumber
4 nMarkerSets
4 nOtherMarkers
4 nRigidBodies
_____
16

nRB=1:
32 ID,x,y,z,qx,qy,qz,qw
4 nRigidMarkers
36 nBytes
NatNet>2.x:
12 nBytes
12 nBytes
NatNet>2.x:
4 fError
_____
100
+16
=116

4 nSkeletons (=0)
4 nLabeledMarkers (=0)
4 latency
4 timecode
4 timecodeSub
NatNet<2.7:
4 timestamp
2 params
4 eod
_____
30
+116
= 146

The value of nBytes at the beginning is 140 (6 Bytes missing).
With two rigid bodies it is 240, also 6 Bytes missing.
But i don't have a problem with it, because i am only using paketinfo and rigidbodydata.
The problem might be at the end of the datapacket.
Post Reply