Server connected but GetLastFrameOfData() under c++ does not work
Posted: Fri Aug 03, 2018 10:57 pm
				
				Hello,
I am having some trouble using GetLastFrameOfData() in Visual Studio 2017 to get any data from the server. I have two computers, one as server and the other as a client, and I am using NatNet 2.8 x64. I tried the SampleClient.cpp, and "theClient->SetDataCallback( DataHandler, theClient )" works fine and displays the data.
However, when I disabled "theClient->SetDataCallback( DataHandler, theClient )" and tried to receive data by GetLastFrameOfData(). I have added the following codes after it has retrieved Data Descriptions: 
But all I received were zeros. The result is displayed as follows:
Does anyone know why? Really appreciate the help!
Best,
Arthur
			I am having some trouble using GetLastFrameOfData() in Visual Studio 2017 to get any data from the server. I have two computers, one as server and the other as a client, and I am using NatNet 2.8 x64. I tried the SampleClient.cpp, and "theClient->SetDataCallback( DataHandler, theClient )" works fine and displays the data.
Code: Select all
[Client] Handling packet from 192.168.1.106: Command=7, nDataBytes=212
FrameID : 26576331
Timestamp :  110734.71
Latency :  110734.71
Timecode : 00:00:00:00.0
Other Markers [Count=0]
Rigid Bodies [Count=1]
Rigid Body [ID=1  Error=0.00  Valid=1]
        x       y       z       qx      qy      qz      qw
        0.28    1.08    -0.24   -0.05   0.87    -0.07   0.48
        Rigid body markers [Count=6]
                MarkerID:1      MarkerSize:0.00 MarkerPos:-0.67,0.41,-0.20
                MarkerID:2      MarkerSize:0.00 MarkerPos:-0.67,0.40,-0.26
                MarkerID:3      MarkerSize:0.00 MarkerPos:-0.74,0.43,-0.18
                MarkerID:4      MarkerSize:0.00 MarkerPos:-0.78,0.43,-0.24
                MarkerID:5      MarkerSize:0.00 MarkerPos:-0.74,0.41,-0.28
                MarkerID:6      MarkerSize:0.00 MarkerPos:0.00,0.00,0.00
Skeletons [Count=0]
Labeled Markers [Count=0]
Code: Select all
	sFrameOfMocapData* pData = theClient->GetLastFrameOfData();
	cout << "pData->nRigidBodies: " << pData->nRigidBodies << endl;
	cout << "pData->nMarkerSets: " << pData->nMarkerSets << endl;
Code: Select all
Connecting to server at 192.168.1.106...
Connecting to server at LocalMachine
NatNet Sample Client (NatNet ver. 2.8.0.0)
[SampleClient] Server application info:
Application: Motive (ver. 1.79.0.0)
NatNet Version: 2.8.0.0
Client IP:192.168.1.104
Server IP:192.168.1.106
Server Name: XXXX
Client initialized and ready.
[SampleClient] Sending Test Request
[SampleClient] Requesting Data Descriptions...[SampleClient] Received 3 Data Descriptions:
Data Description # 0 (type=1)
RigidBody Name : Rigid Body 1
RigidBody ID : 1
// More info here, omitted for brevity. 
Client is connected to server and listening for data...
pData->nRigidBodies: 0
pData->nMarkerSets: 0
Best,
Arthur