DTrackSDK  v2.9.0
DTrackDataTypes.hpp
1 /* DTrackSDK in C++: DTrackDataTypes.hpp
2  *
3  * Data type definitions.
4  *
5  * Copyright (c) 2007-2023 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 
31 #ifndef _ART_DTRACKSDK_DATATYPES_HPP_
32 #define _ART_DTRACKSDK_DATATYPES_HPP_
33 
34 #include <vector>
35 
36 namespace DTrackSDK_Datatypes {
37 
42 {
43  double w;
44  double x;
45  double y;
46  double z;
47 };
48 
55 DTrackQuaternion rot2quat( const double rot[ 9 ] );
56 
57 // -----------------------------------------------------------------------------------------------------
58 
63 {
64  int id;
65  double quality;
66  double loc[ 3 ];
67 };
68 
70 
71 // -----------------------------------------------------------------------------------------------------
72 
76 struct DTrackBody
77 {
78  int id;
79  double quality;
80  double loc[ 3 ];
81  double rot[ 9 ];
82  double covref[ 3 ];
83  double cov[ 36 ];
84 
90  bool isTracked() const
91  { return ( quality >= 0.0 ); }
92 
99  { return rot2quat( rot ); }
100 };
101 
102 typedef DTrackBody DTrack_Body_Type_d;
103 
104 // -----------------------------------------------------------------------------------------------------
105 
110 {
111  int id;
112  int st;
113  double error;
114  double loc[ 3 ];
115  double rot[ 9 ];
116 
122  bool isTracked() const
123  { return ( st > 0 ); }
124 
131  { return rot2quat( rot ); }
132 };
133 
134 typedef DTrackInertial DTrack_Inertial_Type_d;
135 
136 // -----------------------------------------------------------------------------------------------------
137 
138 #define DTRACKSDK_FLYSTICK_MAX_BUTTON 16
139 #define DTRACKSDK_FLYSTICK_MAX_JOYSTICK 8
140 
141 
147 {
148  int id;
149  double quality;
151  int button[ DTRACKSDK_FLYSTICK_MAX_BUTTON ];
153  double joystick[ DTRACKSDK_FLYSTICK_MAX_JOYSTICK ];
154  double loc[ 3 ];
155  double rot[ 9 ];
156 
162  bool isTracked() const
163  { return ( quality >= 0.0 ); }
164 
171  { return rot2quat( rot ); }
172 };
173 
174 typedef DTrackFlyStick DTrack_FlyStick_Type_d;
175 
176 // -----------------------------------------------------------------------------------------------------
177 
178 #define DTRACKSDK_MEATOOL_MAX_BUTTON 16
179 
180 
186 {
187  int id;
188  double quality;
190  int button[ DTRACKSDK_MEATOOL_MAX_BUTTON ];
191  double loc[ 3 ];
192  double rot[ 9 ];
193  double tipradius;
194  double cov[ 9 ];
195 
201  bool isTracked() const
202  { return ( quality >= 0.0 ); }
203 
210  { return rot2quat( rot ); }
211 };
212 
213 typedef DTrackMeaTool DTrack_MeaTool_Type_d;
214 
215 // -----------------------------------------------------------------------------------------------------
216 
221 {
222  int id;
223  double quality;
224  double loc[ 3 ];
225  double rot[ 9 ];
226 
232  bool isTracked() const
233  { return ( quality >= 0.0 ); }
234 
241  { return rot2quat( rot ); }
242 };
243 
244 typedef DTrackMeaRef DTrack_MeaRef_Type_d;
245 
246 // -----------------------------------------------------------------------------------------------------
247 
248 #define DTRACKSDK_HAND_MAX_FINGER 5
249 
250 
254 {
255  int id;
256  double quality;
257  int lr;
258  int nfinger;
259  double loc[ 3 ];
260  double rot[ 9 ];
261 
267  bool isTracked() const
268  { return ( quality >= 0.0 ); }
269 
276  { return rot2quat( rot ); }
277 
282  {
283  double loc[ 3 ];
284  double rot[ 9 ];
285  double radiustip;
286  double lengthphalanx[ 3 ];
287  double anglephalanx[ 2 ];
288 
295  { return rot2quat( rot ); }
296  } finger[ DTRACKSDK_HAND_MAX_FINGER ];
297 };
298 
299 typedef DTrackHand DTrack_Hand_Type_d;
300 
301 // -----------------------------------------------------------------------------------------------------
302 
303 #define DTRACKSDK_HUMAN_MAX_JOINTS 200
304 
305 
311 {
312  int id;
314 
320  bool isTracked() const
321  { return ( num_joints > 0 ); }
322 
326  struct DTrackJoint
327  {
328  int id;
329  double quality;
330  double loc[ 3 ];
331  double ang[ 3 ];
332  double rot[ 9 ];
333 
339  bool isTracked() const
340  { return ( quality >= 0.0 ); }
341 
348  { return rot2quat( rot ); }
349  } joint[ DTRACKSDK_HUMAN_MAX_JOINTS ];
350 };
351 
352 typedef DTrackHuman DTrack_Human_Type_d;
353 
354 // -----------------------------------------------------------------------------------------------------
355 
362 {
363  int idCamera;
364 
368 };
369 
376 {
377  // general status values
381 
382  // message statistics
388 
389  // camera status values
390  std::vector< DTrackCameraStatus > cameraStatus;
391 };
392 
393 
394 } // namespace DTrackSDK_Datatypes
395 
396 #endif // _ART_DTRACKSDK_DATATYPES_HPP_
397 
double loc[3]
Location (in [mm])
double rot[9]
Rotation matrix (column-wise)
DTrackQuaternion getQuaternion() const
Returns rotation as quaternion.
double loc[3]
Location (in [mm])
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)
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.
double cov[9]
Covariance of location (column-wise; in [mm^2])
bool isTracked() const
Returns if Measurement Tool reference is currently tracked.
struct DTrackSDK_Datatypes::DTrackHuman::DTrackJoint joint[DTRACKSDK_HUMAN_MAX_JOINTS]
Joint data.
DTrackQuaternion getQuaternion() const
Returns rotation as quaternion.
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)
DTrackQuaternion getQuaternion() const
Returns rotation of back of the hand as quaternion.
DTrackQuaternion getQuaternion() const
Returns rotation of joint as quaternion.
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)
int id
ID number (starting with 1)
int maxIntensity
Intensity of the brightest pixel (between 0 and 10)
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)
double covref[3]
Reference point of covariance (in [mm])
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])
double loc[3]
Location of joint (in [mm])
double rot[9]
Rotation matrix (column-wise)
int id
ID number (starting with 0)
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)
double loc[3]
Location of back of the hand (in [mm])
double ang[3]
Angles in relation to joint coordinate system; DEPRECATED.
double quality
Quality (0.0 <= qu <= 1.0)
int num_joystick
Number of joystick values.
A.R.T. FINGERTRACKING finger data.
int id
ID number (starting with 0)
int id
ID number (starting with 0)
double rot[9]
Rotation matrix of joint (column-wise) in relation to room coordinate system.
int numCameraErrorMessages
Number of camera-related error messages (since booting)
DTrackQuaternion getQuaternion() const
Returns rotation as quaternion.
int button[DTRACKSDK_FLYSTICK_MAX_BUTTON]
Button state (1 pressed, 0 not pressed): 0 front, 1..n-1 right to left.
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 numReflections
Number of 2DOF reflections seen by this camera.
int idCamera
ID number of the camera (starting with 0)
DTrackQuaternion getQuaternion() const
Returns rotation as quaternion.
int numReflectionsUsed
Number of seen 2DOF reflections used for 6DOF tracking.
DTrackQuaternion getQuaternion() const
Returns rotation of outermost phalanx as quaternion.
int button[DTRACKSDK_MEATOOL_MAX_BUTTON]
Button state (1 pressed, 0 not pressed): 0 point measurement state.
double rot[9]
Rotation matrix (column-wise)
bool isTracked() const
Returns if hand is currently tracked.
int numTrackedMarkers
Number of currently found additional 3DOF markers.
double cov[36]
6x6-dimensional covariance matrix for the 6d pose (with 3d location in [mm], 3d euler angles in [rad]...
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).