DTrackSDK  v2.9.0
example_listening.cpp
1 /* DTrackSDK in C++: example_listening.cpp
2  *
3  * C++ example using DTrackSDK for pure listening.
4  *
5  * Copyright (c) 2005-2024 Advanced Realtime Tracking GmbH & Co. KG
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  * 3. Neither the name of copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  * Purpose:
31  * - example without DTrack2/DTRACK3 remote commands: just collects frames
32  * - please start measurement manually e.g. in DTrack frontend application
33  * - for DTrackSDK v2.9.0 (or newer)
34  */
35 
36 #include "DTrackSDK.hpp"
37 
38 #include <iostream>
39 #include <sstream>
40 #include <iomanip>
41 
42 // global DTrackSDK
43 static DTrackSDK* dt = NULL;
44 
45 // prototypes
46 static void output_to_console();
47 static bool data_error_to_console();
48 
49 
53 int main( int argc, char** argv )
54 {
55  if ( argc != 2 )
56  {
57  std::cout << "Usage: example_listening <data port>" << std::endl;
58  return -1;
59  }
60 
61  std::istringstream portstream( argv[ 1 ] );
62  unsigned short port;
63  portstream >> port; // data port
64 
65  if ( portstream.fail() )
66  {
67  std::cout << "invalid port '" << argv[ 1 ] << "'" << std::endl;
68  return -2;
69  }
70 
71  // initialization:
72 
73  dt = new DTrackSDK( port );
74 
75  if ( ! dt->isDataInterfaceValid() )
76  {
77  std::cout << "DTrackSDK init error" << std::endl;
78  return -3;
79  }
80  std::cout << "listening at local data port " << dt->getDataPort() << std::endl;
81 
82 // dt->setDataTimeoutUS( 3000000 ); // NOTE: change here timeout for receiving tracking data, if necessary
83 // dt->setDataBufferSize( 100000 ); // NOTE: change here buffer size for receiving tracking data, if necessary
84 
85  // measurement:
86 
87 // dt->enableStatefulFirewallConnection( "atc-302301001" ); // NOTE: optionally enable UDP traffic through a
88  // stateful firewall
89 
90  int count = 0;
91  while ( count++ < 1000 ) // collect 1000 frames
92  {
93  if ( dt->receive() )
94  {
95  output_to_console();
96  }
97  else
98  {
99  data_error_to_console();
100  }
101  }
102 
103  delete dt; // clean up
104  return 0;
105 }
106 
107 
111 static void output_to_console()
112 {
113  std::cout.precision( 3 );
114  std::cout.setf( std::ios::fixed, std::ios::floatfield );
115 
116  std::cout << std::endl << "frame " << dt->getFrameCounter() << " ts " << dt->getTimeStamp()
117  << " ets " << dt->getTimeStampSec() << "." << std::setfill( '0' ) << std::setw( 6 ) << dt->getTimeStampUsec()
118  << " lat " << dt->getLatencyUsec()
119  << std::endl;
120 
121  std::cout << " nbod " << dt->getNumBody() << " nfly " << dt->getNumFlyStick()
122  << " nmea " << dt->getNumMeaTool() << " nmearef " << dt->getNumMeaRef()
123  << " nhand " << dt->getNumHand() << " nmar " << dt->getNumMarker()
124  << " nhuman " << dt->getNumHuman() << " ninertial " << dt->getNumInertial()
125  << " status " << ( dt->isStatusAvailable() ? "yes" : "no" )
126  << std::endl;
127 
128  // Standard bodies:
129  for ( int i = 0; i < dt->getNumBody(); i++ )
130  {
131  const DTrackBody* body = dt->getBody( i );
132  if ( body == NULL )
133  {
134  std::cout << "DTrackSDK fatal error: invalid body id " << i << std::endl;
135  break;
136  }
137 
138  if ( ! body->isTracked() )
139  {
140  std::cout << "bod " << body->id << " not tracked" << std::endl;
141  }
142  else
143  {
144  std::cout << "bod " << body->id << " qu " << body->quality
145  << " loc " << body->loc[ 0 ] << " " << body->loc[ 1 ] << " " << body->loc[ 2 ]
146  << " rot " << body->rot[ 0 ] << " " << body->rot[ 1 ] << " " << body->rot[ 2 ]
147  << " " << body->rot[ 3 ] << " " << body->rot[ 4 ] << " " << body->rot[ 5 ]
148  << " " << body->rot[ 6 ] << " " << body->rot[ 7 ] << " " << body->rot[ 8 ]
149  << std::endl;
150 
151  DTrackQuaternion quat = body->getQuaternion();
152  std::cout << "bod " << body->id << " quatw " << quat.w
153  << " quatxyz " << quat.x << " " << quat.y << " " << quat.z << std::endl;
154  }
155  }
156 
157  // A.R.T. Flysticks:
158  for ( int i = 0; i < dt->getNumFlyStick(); i++ )
159  {
160  const DTrackFlyStick* flystick = dt->getFlyStick( i );
161  if ( flystick == NULL )
162  {
163  std::cout << "DTrackSDK fatal error: invalid Flystick id " << i << std::endl;
164  break;
165  }
166 
167  if ( ! flystick->isTracked() )
168  {
169  std::cout << "fly " << flystick->id << " not tracked" << std::endl;
170  }
171  else
172  {
173  std::cout << "flystick " << flystick->id << " qu " << flystick->quality
174  << " loc " << flystick->loc[ 0 ] << " " << flystick->loc[ 1 ] << " " << flystick->loc[ 2 ]
175  << " rot " << flystick->rot[ 0 ] << " " << flystick->rot[ 1 ] << " " << flystick->rot[ 2 ]
176  << " " << flystick->rot[ 3 ] << " " << flystick->rot[ 4 ] << " " << flystick->rot[ 5 ]
177  << " " << flystick->rot[ 6 ] << " " << flystick->rot[ 7 ] << " " << flystick->rot[ 8 ]
178  << std::endl;
179  }
180 
181  std::cout << " btn";
182  for ( int j = 0; j < flystick->num_button; j++ )
183  {
184  std::cout << " " << flystick->button[ j ];
185  }
186  std::cout << " joy";
187  for ( int j = 0; j < flystick->num_joystick; j++ )
188  {
189  std::cout << " " << flystick->joystick[ j ];
190  }
191  std::cout << std::endl;
192  }
193 
194  // Measurement tools:
195  for ( int i = 0; i < dt->getNumMeaTool(); i++ )
196  {
197  const DTrackMeaTool* meatool = dt->getMeaTool( i );
198  if ( meatool == NULL )
199  {
200  std::cout << "DTrackSDK fatal error: invalid Measurement tool id " << i << std::endl;
201  break;
202  }
203 
204  if ( ! meatool->isTracked() )
205  {
206  std::cout << "mea " << meatool->id << " not tracked" << std::endl;
207  }
208  else
209  {
210  std::cout << "mea " << meatool->id << " qu " << meatool->quality
211  << " loc " << meatool->loc[ 0 ] << " " << meatool->loc[ 1 ] << " " << meatool->loc[ 2 ]
212  << " rot " << meatool->rot[ 0 ] << " " << meatool->rot[ 1 ] << " " << meatool->rot[ 2 ]
213  << " " << meatool->rot[ 3 ] << " " << meatool->rot[ 4 ] << " " << meatool->rot[ 5 ]
214  << " " << meatool->rot[ 6 ] << " " << meatool->rot[ 7 ] << " " << meatool->rot[ 8 ]
215  << std::endl;
216  }
217 
218  if ( meatool->tipradius > 0.0 )
219  {
220  std::cout << " radius " << meatool->tipradius << std::endl;
221  }
222 
223  if ( meatool->num_button > 0 )
224  {
225  std::cout << " btn";
226  for ( int j = 0; j < meatool->num_button; j++ )
227  {
228  std::cout << " " << meatool->button[ j ];
229  }
230  std::cout << std::endl;
231  }
232  }
233 
234  // Measurement references:
235  for ( int i = 0; i < dt->getNumMeaRef(); i++ )
236  {
237  const DTrackMeaRef* mearef = dt->getMeaRef( i );
238  if ( mearef == NULL )
239  {
240  std::cout << "DTrackSDK fatal error: invalid Measurement reference id " << i << std::endl;
241  break;
242  }
243 
244  if ( ! mearef->isTracked() )
245  {
246  std::cout << "mearef " << mearef->id << " not tracked" << std::endl;
247  }
248  else
249  {
250  std::cout << "mearef " << mearef->id << " qu " << mearef->quality
251  << " loc " << mearef->loc[ 0 ] << " " << mearef->loc[ 1 ] << " " << mearef->loc[ 2 ]
252  << " rot " << mearef->rot[ 0 ] << " " << mearef->rot[ 1 ] << " " << mearef->rot[ 2 ]
253  << " " << mearef->rot[ 3 ] << " " << mearef->rot[ 4 ] << " " << mearef->rot[ 5 ]
254  << " " << mearef->rot[ 6 ] << " " << mearef->rot[ 7 ] << " " << mearef->rot[ 8 ]
255  << std::endl;
256  }
257  }
258 
259  // Single markers:
260  for ( int i = 0; i < dt->getNumMarker(); i++ )
261  {
262  const DTrackMarker* marker = dt->getMarker( i );
263  if ( marker == NULL )
264  {
265  std::cout << "DTrackSDK fatal error: invalid marker index " << i << std::endl;
266  break;
267  }
268 
269  std::cout << "mar " << marker->id << " qu " << marker->quality
270  << " loc " << marker->loc[ 0 ] << " " << marker->loc[ 1 ] << " " << marker->loc[ 2 ]
271  << std::endl;
272  }
273 
274  // A.R.T. FINGERTRACKING hands:
275  for ( int i = 0; i < dt->getNumHand(); i++ )
276  {
277  const DTrackHand* hand = dt->getHand( i );
278  if ( hand == NULL )
279  {
280  std::cout << "DTrackSDK fatal error: invalid FINGERTRACKING id " << i << std::endl;
281  break;
282  }
283 
284  if ( ! hand->isTracked() )
285  {
286  std::cout << "hand " << hand->id << " not tracked" << std::endl;
287  }
288  else
289  {
290  std::cout << "hand " << hand->id << " qu " << hand->quality
291  << " lr " << ( ( hand->lr == 0 ) ? "left" : "right") << " nf " << hand->nfinger
292  << " loc " << hand->loc[ 0 ] << " " << hand->loc[ 1 ] << " " << hand->loc[ 2 ]
293  << " rot " << hand->rot[ 0 ] << " " << hand->rot[ 1 ] << " " << hand->rot[ 2 ]
294  << " " << hand->rot[ 3 ] << " " << hand->rot[ 4 ] << " " << hand->rot[ 5 ]
295  << " " << hand->rot[ 6 ] << " " << hand->rot[ 7 ] << " " << hand->rot[ 8 ]
296  << std::endl;
297 
298  for ( int j = 0; j < hand->nfinger; j++ )
299  {
300  std::cout << " fi " << j
301  << " loc " << hand->finger[ j ].loc[ 0 ] << " " << hand->finger[ j ].loc[ 1 ] << " " << hand->finger[ j ].loc[ 2 ]
302  << " rot " << hand->finger[ j ].rot[ 0 ] << " " << hand->finger[ j ].rot[ 1 ] << " " << hand->finger[ j ].rot[ 2 ]
303  << " " << hand->finger[ j ].rot[ 3 ] << " " << hand->finger[ j ].rot[ 4 ] << " " << hand->finger[ j ].rot[ 5 ]
304  << " " << hand->finger[ j ].rot[ 6 ] << " " << hand->finger[ j ].rot[ 7 ] << " " << hand->finger[ j ].rot[ 8 ]
305  << std::endl;
306  std::cout << " fi " << j
307  << " tip " << hand->finger[ j ].radiustip
308  << " pha " << hand->finger[ j ].lengthphalanx[ 0 ] << " " << hand->finger[ j ].lengthphalanx[ 1 ]
309  << " " << hand->finger[ j ].lengthphalanx[ 2 ]
310  << " ang " << hand->finger[ j ].anglephalanx[ 0 ] << " " << hand->finger[ j ].anglephalanx[ 1 ]
311  << std::endl;
312  }
313  }
314  }
315 
316  // A.R.T human models:
317  if ( dt->getNumHuman() < 1 )
318  {
319  std::cout << "no human model data" << std::endl;
320  }
321 
322  for ( int i = 0; i < dt->getNumHuman(); i++ )
323  {
324  const DTrackHuman* human = dt->getHuman( i );
325  if ( human == NULL )
326  {
327  std::cout << "DTrackSDK fatal error: invalid human model id " << i << std::endl;
328  break;
329  }
330 
331  if ( ! human->isTracked() )
332  {
333  std::cout << "human " << human->id << " not tracked" << std::endl;
334  }
335  else
336  {
337  std::cout << "human " << human->id << " num joints " << human->num_joints << std::endl;
338  for ( int j = 0; j < human->num_joints; j++ )
339  {
340  if ( ! human->joint[ j ].isTracked() )
341  {
342  std::cout << "joint " << human->joint[ j ].id << " not tracked" << std::endl;
343  }
344  else
345  {
346  std::cout << "joint " << human->joint[ j ].id << " qu " << human->joint[j].quality
347  << " loc " << human->joint[ j ].loc[ 0 ] << " " << human->joint[j].loc[ 1 ] << " " << human->joint[ j ].loc[ 2 ]
348  << " rot " << human->joint[ j ].rot[ 0 ] << " " << human->joint[j].rot[ 1 ] << " " << human->joint[ j ].rot[ 2 ]
349  << " " << human->joint[ j ].rot[ 3 ] << " " << human->joint[j].rot[ 4 ] << " " << human->joint[ j ].rot[ 5 ]
350  << " " << human->joint[ j ].rot[ 6 ] << " " << human->joint[j].rot[ 7 ] << " " << human->joint[ j ].rot[ 8 ]
351  << std::endl;
352  }
353  }
354  }
355  std::cout << std::endl;
356  }
357 
358  // Hybrid bodies:
359  if ( dt->getNumInertial() < 1 )
360  {
361  std::cout << "no inertial body data" << std::endl;
362  }
363 
364  for ( int i = 0; i < dt->getNumInertial(); i++ )
365  {
366  const DTrackInertial* inertial = dt->getInertial( i );
367  if ( inertial == NULL )
368  {
369  std::cout << "DTrackSDK fatal error: invalid hybrid body id " << i << std::endl;
370  break;
371  }
372 
373  std::cout << " inertial body " << inertial->id << " st " << inertial->st << " error " << inertial->error << std::endl;
374  if ( inertial->isTracked() )
375  {
376  std::cout << " loc " << inertial->loc[ 0 ] << " " << inertial->loc[ 1 ] << " " << inertial->loc[ 2 ]
377  << " rot " << inertial->rot[ 0 ] << " " << inertial->rot[ 1 ] << " " << inertial->rot[ 2 ]
378  << " " << inertial->rot[ 3 ] << " " << inertial->rot[ 4 ] << " " << inertial->rot[ 5 ]
379  << " " << inertial->rot[ 6 ] << " " << inertial->rot[ 7 ] << " " << inertial->rot[ 8 ]
380  << std::endl;
381  }
382  }
383 
384  // System status:
385  if ( ! dt->isStatusAvailable() )
386  {
387  std::cout << "no system status data" << std::endl;
388  }
389  else
390  {
391  const DTrackStatus* status = dt->getStatus();
392  if ( status == NULL )
393  {
394  std::cout << "DTrackSDK fatal error: invalid system status" << std::endl;
395  }
396  else
397  {
398  // general status values
399  std::cout << "status gen nc " << status->numCameras
400  << " nb " << status->numTrackedBodies << " nm " << status->numTrackedMarkers << std::endl;
401 
402  // message statistics
403  std::cout << "status msg nce " << status->numCameraErrorMessages << " ncw " << status->numCameraWarningMessages
404  << " noe " << status->numOtherErrorMessages << " now " << status->numOtherWarningMessages
405  << " ni " << status->numInfoMessages << std::endl;
406 
407  // camera status values
408  for ( int i = 0; i < status->numCameras; i++ )
409  {
410  std::cout << "status cam " << status->cameraStatus[ i ].idCamera
411  << " ns " << status->cameraStatus[ i ].numReflections
412  << " nu " << status->cameraStatus[ i ].numReflectionsUsed
413  << " mi " << status->cameraStatus[ i ].maxIntensity << std::endl;
414  }
415  }
416  }
417 }
418 
419 
425 static bool data_error_to_console()
426 {
428  {
429  std::cout << "--- timeout while waiting for tracking data" << std::endl;
430  return false;
431  }
432 
433  if ( dt->getLastDataError() == DTrackSDK::ERR_NET )
434  {
435  std::cout << "--- error while receiving tracking data" << std::endl;
436  return false;
437  }
438 
439  if ( dt->getLastDataError() == DTrackSDK::ERR_PARSE )
440  {
441  std::cout << "--- error while parsing tracking data" << std::endl;
442  return false;
443  }
444 
445  return true;
446 }
447 
double getTimeStamp() const
Get timestamp since midnight.
int getNumFlyStick() const
Get number of calibrated Flysticks.
double loc[3]
Location (in [mm])
const DTrackFlyStick * getFlyStick(int id) const
Get Flystick data.
const DTrackMeaTool * getMeaTool(int id) const
Get Measurement Tool data.
int getNumBody() const
Get number of calibrated standard bodies (as far as known).
bool receive()
Receive and process one tracking data packet.
Definition: DTrackSDK.cpp:441
bool isStatusAvailable() const
Returns if system status data is available.
double rot[9]
Rotation matrix (column-wise)
double loc[3]
Location (in [mm])
unsigned short getDataPort() const
Get UDP data port where tracking data is received.
Definition: DTrackSDK.cpp:321
int numOtherWarningMessages
Number of other warning messages (since booting)
int lr
Left (0) or right (1) hand.
double loc[3]
Location (in [mm])
double loc[3]
Location (in [mm])
Single marker data (3DOF).
double x
Quaternion component x.
double quality
Quality (0.0 <= qu <= 1.0, no tracking if -1.0)
int getNumHand() const
Get number of calibrated A.R.T. FINGERTRACKING hands (as far as known).
A.R.T. Flystick data (6DOF + buttons).
Hybrid (optical-inertial) body data (6DOF).
double error
Drift error estimate (only during inertial tracking, in [deg])
bool isTracked() const
Returns if joint is currently tracked.
std::vector< DTrackCameraStatus > cameraStatus
Camera status.
double quality
Quality of joint (0.0 <= qu <= 1.0, no tracking if -1.0)
Measurement Tool data (6DOF + buttons).
A.R.T. FINGERTRACKING hand data (6DOF + fingers).
int numInfoMessages
Number of info messages (since booting)
int numTrackedBodies
Number of currently tracked 6DOF bodies.
const DTrackBody * getBody(int id) const
Get standard body data.
bool isTracked() const
Returns if Measurement Tool reference is currently tracked.
struct DTrackSDK_Datatypes::DTrackHuman::DTrackJoint joint[DTRACKSDK_HUMAN_MAX_JOINTS]
Joint data.
double y
Quaternion component y.
int nfinger
Number of fingers (maximum 5)
double quality
Quality (0.0 <= qu <= 1.0, no tracking if -1.0)
double rot[9]
Rotation matrix of outermost phalanx (column-wise)
double loc[3]
Location of tip (in [mm])
int id
ID number (starting with 0)
double quality
Quality (0.0 <= qu <= 1.0, no tracking if -1.0)
const DTrackMeaRef * getMeaRef(int id) const
Get Measurement Tool reference data.
DTrack SDK main class derived from DTrackParser.
Definition: DTrackSDK.hpp:77
int id
ID number (starting with 1)
const DTrackMarker * getMarker(int index) const
Get single marker data.
unsigned int getLatencyUsec() const
Get latency (delay between exposure and sending UDP data in Controller).
int getNumMeaRef() const
Get number of calibrated Measurement Tool references.
double anglephalanx[2]
Angle between phalanxes (order: outermost, innermost; in [deg])
int st
State of hybrid body (0: not tracked, 1: inertial tracking, 2: optical tracking, 3: inertial and opti...
bool isTracked() const
Returns if body is currently tracked.
double tipradius
Radius of tip (in [mm]) if applicable.
double rot[9]
Rotation matrix (column-wise)
int numCameraWarningMessages
Number of camera-related warning messages (since booting)
int id
ID number of joint (starting with 0)
int numOtherErrorMessages
Number of other error messages (since booting)
double lengthphalanx[3]
Length of phalanxes (order: outermost, middle, innermost; in [mm])
int getNumMarker() const
Get number of tracked single markers.
double loc[3]
Location of joint (in [mm])
unsigned int getFrameCounter() const
Get frame counter.
double rot[9]
Rotation matrix (column-wise)
unsigned int getTimeStampUsec() const
Get timestamp since Unix epoch (1970-01-01 00:00:00), microseconds.
int id
ID number (starting with 0)
const DTrackHuman * getHuman(int id) const
Get ART-Human model data.
int id
ID number (starting with 0)
double quality
Quality (0.0 <= qu <= 1.0, no tracking if -1.0)
double quality
Quality (0.0 <= qu <= 1.0, no tracking if -1.0)
unsigned int getTimeStampSec() const
Get timestamp since Unix epoch (1970-01-01 00:00:00), seconds.
double loc[3]
Location of back of the hand (in [mm])
const DTrackHand * getHand(int id) const
Get A.R.T. FINGERTRACKING hand data.
double quality
Quality (0.0 <= qu <= 1.0)
int num_joystick
Number of joystick values.
Timeout occured.
Definition: DTrackSDK.hpp:93
int id
ID number (starting with 0)
int id
ID number (starting with 0)
Error while parsing command.
Definition: DTrackSDK.hpp:95
bool isDataInterfaceValid() const
Returns if UDP socket is open to receive tracking data on local machine.
Definition: DTrackSDK.cpp:310
double rot[9]
Rotation matrix of joint (column-wise) in relation to room coordinate system.
const DTrackInertial * getInertial(int id) const
Get hybrid (optical-inertial) data.
Errors getLastDataError() const
Get last error at receiving tracking data (data transmission).
Definition: DTrackSDK.cpp:549
int numCameraErrorMessages
Number of camera-related error messages (since booting)
int getNumInertial() const
Get number of calibrated hybrid (optical-inertial) bodies.
int button[DTRACKSDK_FLYSTICK_MAX_BUTTON]
Button state (1 pressed, 0 not pressed): 0 front, 1..n-1 right to left.
const DTrackStatus * getStatus() const
Get system status data.
bool isTracked() const
Returns if human model is currently tracked.
double rot[9]
Rotation matrix of back of the hand (column-wise)
Measurement Tool reference data (6DOF).
double w
Quaternion component w.
double z
Quaternion component z.
bool isTracked() const
Returns if Measurement Tool is currently tracked.
double rot[9]
Rotation matrix (column-wise)
struct DTrackSDK_Datatypes::DTrackHand::DTrackFinger finger[DTRACKSDK_HAND_MAX_FINGER]
Finger data (order: thumb, index finger, middle finger, ...)
DTrackQuaternion getQuaternion() const
Returns rotation as quaternion.
bool isTracked() const
Returns if Flystick is currently tracked.
int button[DTRACKSDK_MEATOOL_MAX_BUTTON]
Button state (1 pressed, 0 not pressed): 0 point measurement state.
double rot[9]
Rotation matrix (column-wise)
int getNumHuman() const
Get number of calibrated ART-Human models.
bool isTracked() const
Returns if hand is currently tracked.
Network error.
Definition: DTrackSDK.hpp:94
int numTrackedMarkers
Number of currently found additional 3DOF markers.
double loc[3]
Location (in [mm])
Standard body data (6DOF).
double loc[3]
Location (in [mm])
double joystick[DTRACKSDK_FLYSTICK_MAX_JOYSTICK]
Joystick value (-1.0 <= joystick <= 1.0); 0 horizontal, 1 vertical.
bool isTracked() const
Returns if body is currently tracked.
int id
ID number (starting with 0)
int id
ID number of human model (starting with 0)
ART-Human model (joints (6DOF) including optional Fingertracking).
int getNumMeaTool() const
Get number of calibrated Measurement Tools.