vicon
ViconDump.cpp
Go to the documentation of this file.
1 //
3 // Copyright (C) OMG Plc 2009.
4 // All rights reserved. This software is protected by copyright
5 // law and international treaties. No part of this software / document
6 // may be reproduced or distributed in any form or by any means,
7 // whether transiently or incidentally to some other use of this software,
8 // without the written permission of the copyright owner.
9 //
11 #include "Client.h"
12 #include <iostream>
13 #include <unistd.h>
14 
15 #ifdef WIN32
16  #include <conio.h> // For _kbhit()
17  #include <windows.h> // For Sleep()
18 #endif // WIN32
19 
20 using namespace ViconDataStreamSDK::CPP;
21 
22 namespace
23 {
24  std::string Adapt( const bool i_Value )
25  {
26  return i_Value ? "True" : "False";
27  }
28 
29  std::string Adapt( const Direction::Enum i_Direction )
30  {
31  switch( i_Direction )
32  {
33  case Direction::Forward:
34  return "Forward";
36  return "Backward";
37  case Direction::Left:
38  return "Left";
39  case Direction::Right:
40  return "Right";
41  case Direction::Up:
42  return "Up";
43  case Direction::Down:
44  return "Down";
45  default:
46  return "Unknown";
47  }
48  }
49 
50  std::string Adapt( const DeviceType::Enum i_DeviceType )
51  {
52  switch( i_DeviceType )
53  {
55  return "ForcePlate";
57  default:
58  return "Unknown";
59  }
60  }
61 
62  std::string Adapt( const Unit::Enum i_Unit )
63  {
64  switch( i_Unit )
65  {
66  case Unit::Meter:
67  return "Meter";
68  case Unit::Volt:
69  return "Volt";
70  case Unit::NewtonMeter:
71  return "NewtonMeter";
72  case Unit::Newton:
73  return "Newton";
74  case Unit::Unknown:
75  default:
76  return "Unknown";
77  }
78  }
79 }
80 
81 int main( int argc, char* argv[] )
82 {
83  // Program options
84  bool TransmitMulticast = false;
85 
86  std::string HostName = "localhost:801";
87  if( argc == 2 )
88  {
89  HostName = argv[1];
90  }
91 
92  // Make a new client
93  Client MyClient;
94 
95  // Connect to a server
96  std::cout << "Connecting to " << HostName << " ..." << std::flush;
97  while( !MyClient.IsConnected().Connected )
98  {
99  // Direct connection
100  MyClient.Connect( HostName );
101 
102  // Multicast connection
103  // MyClient.ConnectToMulticast( HostName, "224.0.0.0" );
104 
105  std::cout << ".";
106 #ifdef WIN32
107  Sleep( 200 );
108 #else
109  sleep(1);
110 #endif
111  }
112  std::cout << std::endl;
113 
114  // Enable some different data types
115  MyClient.EnableSegmentData();
116  MyClient.EnableMarkerData();
117  MyClient.EnableUnlabeledMarkerData();
118  MyClient.EnableDeviceData();
119 
120  std::cout << "Segment Data Enabled: " << Adapt( MyClient.IsSegmentDataEnabled().Enabled ) << std::endl;
121  std::cout << "Marker Data Enabled: " << Adapt( MyClient.IsMarkerDataEnabled().Enabled ) << std::endl;
122  std::cout << "Unlabeled Marker Data Enabled: " << Adapt( MyClient.IsUnlabeledMarkerDataEnabled().Enabled ) << std::endl;
123  std::cout << "Device Data Enabled: " << Adapt( MyClient.IsDeviceDataEnabled().Enabled ) << std::endl;
124 
125  // Set the streaming mode
127  // MyClient.SetStreamMode( ViconDataStreamSDK::CPP::StreamMode::ClientPullPreFetch );
128  // MyClient.SetStreamMode( ViconDataStreamSDK::CPP::StreamMode::ServerPush );
129 
130  // Set the global up axis
133  Direction::Up ); // Z-up
134  // MyClient.SetGlobalUpAxis( Direction::Forward,
135  // Direction::Up,
136  // Direction::Right ); // Y-up
137 
138  Output_GetAxisMapping _Output_GetAxisMapping = MyClient.GetAxisMapping();
139  std::cout << "Axis Mapping: X-" << Adapt( _Output_GetAxisMapping.XAxis )
140  << " Y-" << Adapt( _Output_GetAxisMapping.YAxis )
141  << " Z-" << Adapt( _Output_GetAxisMapping.ZAxis ) << std::endl;
142 
143  // Discover the version number
144  Output_GetVersion _Output_GetVersion = MyClient.GetVersion();
145  std::cout << "Version: " << _Output_GetVersion.Major << "."
146  << _Output_GetVersion.Minor << "."
147  << _Output_GetVersion.Point << std::endl;
148 
149  if( TransmitMulticast )
150  {
151  MyClient.StartTransmittingMulticast( "localhost", "224.0.0.0" );
152  }
153 
154  // Loop until a key is pressed
155 #ifdef WIN32
156  while( !_kbhit() )
157 #else
158  while( true)
159 #endif
160  {
161  // Get a frame
162  std::cout << "Waiting for new frame...";
163  while( MyClient.GetFrame().Result != Result::Success )
164  {
165  // Sleep a little so that we don't lumber the CPU with a busy poll
166  #ifdef WIN32
167  Sleep( 200 );
168  #else
169  sleep(1);
170  #endif
171 
172  std::cout << ".";
173  }
174  std::cout << std::endl;
175 
176  // Get the frame number
177  Output_GetFrameNumber _Output_GetFrameNumber = MyClient.GetFrameNumber();
178  std::cout << "Frame Number: " << _Output_GetFrameNumber.FrameNumber << std::endl;
179 
180  // Get the timecode
181  Output_GetTimecode _Output_GetTimecode = MyClient.GetTimecode();
182 
183  std::cout << "Timecode: "
184  << _Output_GetTimecode.Hours << "h "
185  << _Output_GetTimecode.Minutes << "m "
186  << _Output_GetTimecode.Seconds << "s "
187  << _Output_GetTimecode.Frames << "f "
188  << _Output_GetTimecode.SubFrame << "sf "
189  << Adapt( _Output_GetTimecode.FieldFlag ) << " "
190  << _Output_GetTimecode.Standard << " "
191  << _Output_GetTimecode.SubFramesPerFrame << " "
192  << _Output_GetTimecode.UserBits << std::endl << std::endl;
193 
194  // Get the latency
195  std::cout << "Latency: " << MyClient.GetLatencyTotal().Total << "s" << std::endl;
196 
197  for( unsigned int LatencySampleIndex = 0 ; LatencySampleIndex < MyClient.GetLatencySampleCount().Count ; ++LatencySampleIndex )
198  {
199  std::string SampleName = MyClient.GetLatencySampleName( LatencySampleIndex ).Name;
200  double SampleValue = MyClient.GetLatencySampleValue( SampleName ).Value;
201 
202  std::cout << " " << SampleName << " " << SampleValue << "s" << std::endl;
203  }
204  std::cout << std::endl;
205 
206  // Count the number of subjects
207  unsigned int SubjectCount = MyClient.GetSubjectCount().SubjectCount;
208  std::cout << "Subjects (" << SubjectCount << "):" << std::endl;
209  for( unsigned int SubjectIndex = 0 ; SubjectIndex < SubjectCount ; ++SubjectIndex )
210  {
211  std::cout << " Subject #" << SubjectIndex << std::endl;
212 
213  // Get the subject name
214  std::string SubjectName = MyClient.GetSubjectName( SubjectIndex ).SubjectName;
215  std::cout << " Name: " << SubjectName << std::endl;
216 
217  // Get the root segment
218  std::string RootSegment = MyClient.GetSubjectRootSegmentName( SubjectName ).SegmentName;
219  std::cout << " Root Segment: " << RootSegment << std::endl;
220 
221  // Count the number of segments
222  unsigned int SegmentCount = MyClient.GetSegmentCount( SubjectName ).SegmentCount;
223  std::cout << " Segments (" << SegmentCount << "):" << std::endl;
224  for( unsigned int SegmentIndex = 0 ; SegmentIndex < SegmentCount ; ++SegmentIndex )
225  {
226  std::cout << " Segment #" << SegmentIndex << std::endl;
227 
228  // Get the segment name
229  std::string SegmentName = MyClient.GetSegmentName( SubjectName, SegmentIndex ).SegmentName;
230  std::cout << " Name: " << SegmentName << std::endl;
231 
232  // Get the segment parent
233  std::string SegmentParentName = MyClient.GetSegmentParentName( SubjectName, SegmentName ).SegmentName;
234  std::cout << " Parent: " << SegmentParentName << std::endl;
235 
236  // Get the segment's children
237  unsigned int ChildCount = MyClient.GetSegmentChildCount( SubjectName, SegmentName ).SegmentCount;
238  std::cout << " Children (" << ChildCount << "):" << std::endl;
239  for( unsigned int ChildIndex = 0 ; ChildIndex < ChildCount ; ++ChildIndex )
240  {
241  std::string ChildName = MyClient.GetSegmentChildName( SubjectName, SegmentName, ChildIndex ).SegmentName;
242  std::cout << " " << ChildName << std::endl;
243  }
244 
245  // Get the static segment translation
246  Output_GetSegmentStaticTranslation _Output_GetSegmentStaticTranslation =
247  MyClient.GetSegmentStaticTranslation( SubjectName, SegmentName );
248  std::cout << " Static Translation: (" << _Output_GetSegmentStaticTranslation.Translation[ 0 ] << ", "
249  << _Output_GetSegmentStaticTranslation.Translation[ 1 ] << ", "
250  << _Output_GetSegmentStaticTranslation.Translation[ 2 ] << ") " << std::endl;
251 
252  // Get the static segment rotation in helical co-ordinates
253  Output_GetSegmentStaticRotationHelical _Output_GetSegmentStaticRotationHelical =
254  MyClient.GetSegmentStaticRotationHelical( SubjectName, SegmentName );
255  std::cout << " Static Rotation Helical: (" << _Output_GetSegmentStaticRotationHelical.Rotation[ 0 ] << ", "
256  << _Output_GetSegmentStaticRotationHelical.Rotation[ 1 ] << ", "
257  << _Output_GetSegmentStaticRotationHelical.Rotation[ 2 ] << ") " << std::endl;
258 
259  // Get the static segment rotation as a matrix
260  Output_GetSegmentStaticRotationMatrix _Output_GetSegmentStaticRotationMatrix =
261  MyClient.GetSegmentStaticRotationMatrix( SubjectName, SegmentName );
262  std::cout << " Static Rotation Matrix: (" << _Output_GetSegmentStaticRotationMatrix.Rotation[ 0 ] << ", "
263  << _Output_GetSegmentStaticRotationMatrix.Rotation[ 1 ] << ", "
264  << _Output_GetSegmentStaticRotationMatrix.Rotation[ 2 ] << ", "
265  << _Output_GetSegmentStaticRotationMatrix.Rotation[ 3 ] << ", "
266  << _Output_GetSegmentStaticRotationMatrix.Rotation[ 4 ] << ", "
267  << _Output_GetSegmentStaticRotationMatrix.Rotation[ 5 ] << ", "
268  << _Output_GetSegmentStaticRotationMatrix.Rotation[ 6 ] << ", "
269  << _Output_GetSegmentStaticRotationMatrix.Rotation[ 7 ] << ", "
270  << _Output_GetSegmentStaticRotationMatrix.Rotation[ 8 ] << ") " << std::endl;
271 
272  // Get the static segment rotation in quaternion co-ordinates
273  Output_GetSegmentStaticRotationQuaternion _Output_GetSegmentStaticRotationQuaternion =
274  MyClient.GetSegmentStaticRotationQuaternion( SubjectName, SegmentName );
275  std::cout << " Static Rotation Quaternion: (" << _Output_GetSegmentStaticRotationQuaternion.Rotation[ 0 ] << ", "
276  << _Output_GetSegmentStaticRotationQuaternion.Rotation[ 1 ] << ", "
277  << _Output_GetSegmentStaticRotationQuaternion.Rotation[ 2 ] << ", "
278  << _Output_GetSegmentStaticRotationQuaternion.Rotation[ 3 ] << ") " << std::endl;
279 
280  // Get the static segment rotation in EulerXYZ co-ordinates
281  Output_GetSegmentStaticRotationEulerXYZ _Output_GetSegmentStaticRotationEulerXYZ =
282  MyClient.GetSegmentStaticRotationEulerXYZ( SubjectName, SegmentName );
283  std::cout << " Static Rotation EulerXYZ: (" << _Output_GetSegmentStaticRotationEulerXYZ.Rotation[ 0 ] << ", "
284  << _Output_GetSegmentStaticRotationEulerXYZ.Rotation[ 1 ] << ", "
285  << _Output_GetSegmentStaticRotationEulerXYZ.Rotation[ 2 ] << ") " << std::endl;
286 
287  // Get the global segment translation
288  Output_GetSegmentGlobalTranslation _Output_GetSegmentGlobalTranslation =
289  MyClient.GetSegmentGlobalTranslation( SubjectName, SegmentName );
290  std::cout << " Global Translation: (" << _Output_GetSegmentGlobalTranslation.Translation[ 0 ] << ", "
291  << _Output_GetSegmentGlobalTranslation.Translation[ 1 ] << ", "
292  << _Output_GetSegmentGlobalTranslation.Translation[ 2 ] << ") "
293  << Adapt( _Output_GetSegmentGlobalTranslation.Occluded ) << std::endl;
294 
295  // Get the global segment rotation in helical co-ordinates
296  Output_GetSegmentGlobalRotationHelical _Output_GetSegmentGlobalRotationHelical =
297  MyClient.GetSegmentGlobalRotationHelical( SubjectName, SegmentName );
298  std::cout << " Global Rotation Helical: (" << _Output_GetSegmentGlobalRotationHelical.Rotation[ 0 ] << ", "
299  << _Output_GetSegmentGlobalRotationHelical.Rotation[ 1 ] << ", "
300  << _Output_GetSegmentGlobalRotationHelical.Rotation[ 2 ] << ") "
301  << Adapt( _Output_GetSegmentGlobalRotationHelical.Occluded ) << std::endl;
302 
303  // Get the global segment rotation as a matrix
304  Output_GetSegmentGlobalRotationMatrix _Output_GetSegmentGlobalRotationMatrix =
305  MyClient.GetSegmentGlobalRotationMatrix( SubjectName, SegmentName );
306  std::cout << " Global Rotation Matrix: (" << _Output_GetSegmentGlobalRotationMatrix.Rotation[ 0 ] << ", "
307  << _Output_GetSegmentGlobalRotationMatrix.Rotation[ 1 ] << ", "
308  << _Output_GetSegmentGlobalRotationMatrix.Rotation[ 2 ] << ", "
309  << _Output_GetSegmentGlobalRotationMatrix.Rotation[ 3 ] << ", "
310  << _Output_GetSegmentGlobalRotationMatrix.Rotation[ 4 ] << ", "
311  << _Output_GetSegmentGlobalRotationMatrix.Rotation[ 5 ] << ", "
312  << _Output_GetSegmentGlobalRotationMatrix.Rotation[ 6 ] << ", "
313  << _Output_GetSegmentGlobalRotationMatrix.Rotation[ 7 ] << ", "
314  << _Output_GetSegmentGlobalRotationMatrix.Rotation[ 8 ] << ") "
315  << Adapt( _Output_GetSegmentGlobalRotationMatrix.Occluded ) << std::endl;
316 
317  // Get the global segment rotation in quaternion co-ordinates
318  Output_GetSegmentGlobalRotationQuaternion _Output_GetSegmentGlobalRotationQuaternion =
319  MyClient.GetSegmentGlobalRotationQuaternion( SubjectName, SegmentName );
320  std::cout << " Global Rotation Quaternion: (" << _Output_GetSegmentGlobalRotationQuaternion.Rotation[ 0 ] << ", "
321  << _Output_GetSegmentGlobalRotationQuaternion.Rotation[ 1 ] << ", "
322  << _Output_GetSegmentGlobalRotationQuaternion.Rotation[ 2 ] << ", "
323  << _Output_GetSegmentGlobalRotationQuaternion.Rotation[ 3 ] << ") "
324  << Adapt( _Output_GetSegmentGlobalRotationQuaternion.Occluded ) << std::endl;
325 
326  // Get the global segment rotation in EulerXYZ co-ordinates
327  Output_GetSegmentGlobalRotationEulerXYZ _Output_GetSegmentGlobalRotationEulerXYZ =
328  MyClient.GetSegmentGlobalRotationEulerXYZ( SubjectName, SegmentName );
329  std::cout << " Global Rotation EulerXYZ: (" << _Output_GetSegmentGlobalRotationEulerXYZ.Rotation[ 0 ] << ", "
330  << _Output_GetSegmentGlobalRotationEulerXYZ.Rotation[ 1 ] << ", "
331  << _Output_GetSegmentGlobalRotationEulerXYZ.Rotation[ 2 ] << ") "
332  << Adapt( _Output_GetSegmentGlobalRotationEulerXYZ.Occluded ) << std::endl;
333 
334  // Get the local segment translation
335  Output_GetSegmentLocalTranslation _Output_GetSegmentLocalTranslation =
336  MyClient.GetSegmentLocalTranslation( SubjectName, SegmentName );
337  std::cout << " Local Translation: (" << _Output_GetSegmentLocalTranslation.Translation[ 0 ] << ", "
338  << _Output_GetSegmentLocalTranslation.Translation[ 1 ] << ", "
339  << _Output_GetSegmentLocalTranslation.Translation[ 2 ] << ") "
340  << Adapt( _Output_GetSegmentLocalTranslation.Occluded ) << std::endl;
341 
342  // Get the local segment rotation in helical co-ordinates
343  Output_GetSegmentLocalRotationHelical _Output_GetSegmentLocalRotationHelical =
344  MyClient.GetSegmentLocalRotationHelical( SubjectName, SegmentName );
345  std::cout << " Local Rotation Helical: (" << _Output_GetSegmentLocalRotationHelical.Rotation[ 0 ] << ", "
346  << _Output_GetSegmentLocalRotationHelical.Rotation[ 1 ] << ", "
347  << _Output_GetSegmentLocalRotationHelical.Rotation[ 2 ] << ") "
348  << Adapt( _Output_GetSegmentLocalRotationHelical.Occluded ) << std::endl;
349 
350  // Get the local segment rotation as a matrix
351  Output_GetSegmentLocalRotationMatrix _Output_GetSegmentLocalRotationMatrix =
352  MyClient.GetSegmentLocalRotationMatrix( SubjectName, SegmentName );
353  std::cout << " Local Rotation Matrix: (" << _Output_GetSegmentLocalRotationMatrix.Rotation[ 0 ] << ", "
354  << _Output_GetSegmentLocalRotationMatrix.Rotation[ 1 ] << ", "
355  << _Output_GetSegmentLocalRotationMatrix.Rotation[ 2 ] << ", "
356  << _Output_GetSegmentLocalRotationMatrix.Rotation[ 3 ] << ", "
357  << _Output_GetSegmentLocalRotationMatrix.Rotation[ 4 ] << ", "
358  << _Output_GetSegmentLocalRotationMatrix.Rotation[ 5 ] << ", "
359  << _Output_GetSegmentLocalRotationMatrix.Rotation[ 6 ] << ", "
360  << _Output_GetSegmentLocalRotationMatrix.Rotation[ 7 ] << ", "
361  << _Output_GetSegmentLocalRotationMatrix.Rotation[ 8 ] << ") "
362  << Adapt( _Output_GetSegmentLocalRotationMatrix.Occluded ) << std::endl;
363 
364  // Get the local segment rotation in quaternion co-ordinates
365  Output_GetSegmentLocalRotationQuaternion _Output_GetSegmentLocalRotationQuaternion =
366  MyClient.GetSegmentLocalRotationQuaternion( SubjectName, SegmentName );
367  std::cout << " Local Rotation Quaternion: (" << _Output_GetSegmentLocalRotationQuaternion.Rotation[ 0 ] << ", "
368  << _Output_GetSegmentLocalRotationQuaternion.Rotation[ 1 ] << ", "
369  << _Output_GetSegmentLocalRotationQuaternion.Rotation[ 2 ] << ", "
370  << _Output_GetSegmentLocalRotationQuaternion.Rotation[ 3 ] << ") "
371  << Adapt( _Output_GetSegmentLocalRotationQuaternion.Occluded ) << std::endl;
372 
373  // Get the local segment rotation in EulerXYZ co-ordinates
374  Output_GetSegmentLocalRotationEulerXYZ _Output_GetSegmentLocalRotationEulerXYZ =
375  MyClient.GetSegmentLocalRotationEulerXYZ( SubjectName, SegmentName );
376  std::cout << " Local Rotation EulerXYZ: (" << _Output_GetSegmentLocalRotationEulerXYZ.Rotation[ 0 ] << ", "
377  << _Output_GetSegmentLocalRotationEulerXYZ.Rotation[ 1 ] << ", "
378  << _Output_GetSegmentLocalRotationEulerXYZ.Rotation[ 2 ] << ") "
379  << Adapt( _Output_GetSegmentLocalRotationEulerXYZ.Occluded ) << std::endl;
380  }
381 
382  // Count the number of markers
383  unsigned int MarkerCount = MyClient.GetMarkerCount( SubjectName ).MarkerCount;
384  std::cout << " Markers (" << MarkerCount << "):" << std::endl;
385  for( unsigned int MarkerIndex = 0 ; MarkerIndex < MarkerCount ; ++MarkerIndex )
386  {
387  // Get the marker name
388  std::string MarkerName = MyClient.GetMarkerName( SubjectName, MarkerIndex ).MarkerName;
389 
390  // Get the marker parent
391  std::string MarkerParentName = MyClient.GetMarkerParentName( SubjectName, MarkerName ).SegmentName;
392 
393  // Get the global marker translation
394  Output_GetMarkerGlobalTranslation _Output_GetMarkerGlobalTranslation =
395  MyClient.GetMarkerGlobalTranslation( SubjectName, MarkerName );
396 
397  std::cout << " Marker #" << MarkerIndex << ": "
398  << MarkerName << " ("
399  << _Output_GetMarkerGlobalTranslation.Translation[ 0 ] << ", "
400  << _Output_GetMarkerGlobalTranslation.Translation[ 1 ] << ", "
401  << _Output_GetMarkerGlobalTranslation.Translation[ 2 ] << ") "
402  << Adapt( _Output_GetMarkerGlobalTranslation.Occluded ) << std::endl;
403  }
404  }
405 
406  // Get the unlabeled markers
407  unsigned int UnlabeledMarkerCount = MyClient.GetUnlabeledMarkerCount().MarkerCount;
408  std::cout << " Unlabeled Markers (" << UnlabeledMarkerCount << "):" << std::endl;
409  for( unsigned int UnlabeledMarkerIndex = 0 ; UnlabeledMarkerIndex < UnlabeledMarkerCount ; ++UnlabeledMarkerIndex )
410  {
411  // Get the global marker translation
412  Output_GetUnlabeledMarkerGlobalTranslation _Output_GetUnlabeledMarkerGlobalTranslation =
413  MyClient.GetUnlabeledMarkerGlobalTranslation( UnlabeledMarkerIndex );
414 
415  std::cout << " Marker #" << UnlabeledMarkerIndex << ": ("
416  << _Output_GetUnlabeledMarkerGlobalTranslation.Translation[ 0 ] << ", "
417  << _Output_GetUnlabeledMarkerGlobalTranslation.Translation[ 1 ] << ", "
418  << _Output_GetUnlabeledMarkerGlobalTranslation.Translation[ 2 ] << ") " << std::endl;
419  }
420 
421  // Count the number of devices
422  unsigned int DeviceCount = MyClient.GetDeviceCount().DeviceCount;
423  std::cout << " Devices (" << DeviceCount << "):" << std::endl;
424  for( unsigned int DeviceIndex = 0 ; DeviceIndex < DeviceCount ; ++DeviceIndex )
425  {
426  std::cout << " Device #" << DeviceIndex << ":" << std::endl;
427 
428  // Get the device name and type
429  Output_GetDeviceName _Output_GetDeviceName = MyClient.GetDeviceName( DeviceIndex );
430  std::cout << " Name: " << _Output_GetDeviceName.DeviceName << std::endl;
431  std::cout << " Type: " << Adapt( _Output_GetDeviceName.DeviceType ) << std::endl;
432 
433  // Count the number of device outputs
434  unsigned int DeviceOutputCount = MyClient.GetDeviceOutputCount( _Output_GetDeviceName.DeviceName ).DeviceOutputCount;
435  std::cout << " Device Outputs (" << DeviceOutputCount << "):" << std::endl;
436  for( unsigned int DeviceOutputIndex = 0 ; DeviceOutputIndex < DeviceOutputCount ; ++DeviceOutputIndex )
437  {
438  // Get the device output name and unit
439  Output_GetDeviceOutputName _Output_GetDeviceOutputName =
440  MyClient.GetDeviceOutputName( _Output_GetDeviceName.DeviceName, DeviceOutputIndex );
441 
442  // Get the device output value
443  Output_GetDeviceOutputValue _Output_GetDeviceOutputValue =
444  MyClient.GetDeviceOutputValue( _Output_GetDeviceName.DeviceName, _Output_GetDeviceOutputName.DeviceOutputName );
445 
446  std::cout << " Device Output #" << DeviceOutputIndex << ": "
447  << _Output_GetDeviceOutputName.DeviceOutputName << " "
448  << _Output_GetDeviceOutputValue.Value << " "
449  << Adapt( _Output_GetDeviceOutputName.DeviceOutputUnit ) << " "
450  << Adapt( _Output_GetDeviceOutputValue.Occluded ) << std::endl;
451  }
452  }
453  }
454 
455  if( TransmitMulticast )
456  {
457  MyClient.StopTransmittingMulticast();
458  }
459 
460  // Disconnect and dispose
461  MyClient.Disconnect();
462 }
Output_EnableUnlabeledMarkerData EnableUnlabeledMarkerData()
Output_GetSegmentChildName GetSegmentChildName(const String &SubjectName, const String &SegmentName, const unsigned int SegmentIndex) const
Output_GetSegmentStaticRotationEulerXYZ GetSegmentStaticRotationEulerXYZ(const String &SubjectName, const String &SegmentName) const
Output_GetLatencyTotal GetLatencyTotal() const
Output_GetSegmentStaticRotationHelical GetSegmentStaticRotationHelical(const String &SubjectName, const String &SegmentName) const
Output_GetDeviceCount GetDeviceCount() const
Output_GetUnlabeledMarkerCount GetUnlabeledMarkerCount() const
Output_GetAxisMapping GetAxisMapping() const
Output_GetUnlabeledMarkerGlobalTranslation GetUnlabeledMarkerGlobalTranslation(const unsigned int MarkerIndex) const
Output_GetSegmentLocalRotationEulerXYZ GetSegmentLocalRotationEulerXYZ(const String &SubjectName, const String &SegmentName) const
Output_EnableSegmentData EnableSegmentData()
Output_GetSegmentParentName GetSegmentParentName(const String &SubjectName, const String &SegmentName) const
Output_IsUnlabeledMarkerDataEnabled IsUnlabeledMarkerDataEnabled() const
Output_GetLatencySampleName GetLatencySampleName(const unsigned int LatencySampleIndex) const
Output_IsMarkerDataEnabled IsMarkerDataEnabled() const
Output_GetDeviceOutputValue GetDeviceOutputValue(const String &DeviceName, const String &DeviceOutputName) const
Output_GetDeviceOutputCount GetDeviceOutputCount(const String &DeviceName) const
Output_GetSegmentStaticTranslation GetSegmentStaticTranslation(const String &SubjectName, const String &SegmentName) const
Output_GetFrameNumber GetFrameNumber() const
Output_GetSegmentCount GetSegmentCount(const String &SubjectName) const
Output_StartTransmittingMulticast StartTransmittingMulticast(const String &ServerIP, const String &MulticastIP)
Output_GetSegmentStaticRotationMatrix GetSegmentStaticRotationMatrix(const String &SubjectName, const String &SegmentName) const
Output_EnableDeviceData EnableDeviceData()
Output_GetSegmentGlobalRotationMatrix GetSegmentGlobalRotationMatrix(const String &SubjectName, const String &SegmentName) const
Output_GetMarkerGlobalTranslation GetMarkerGlobalTranslation(const String &SubjectName, const String &MarkerName) const
Output_GetTimecode GetTimecode() const
Output_GetDeviceOutputName GetDeviceOutputName(const String &DeviceName, const unsigned int DeviceOutputIndex) const
Output_GetLatencySampleCount GetLatencySampleCount() const
Output_GetSegmentStaticRotationQuaternion GetSegmentStaticRotationQuaternion(const String &SubjectName, const String &SegmentName) const
Output_SetAxisMapping SetAxisMapping(const Direction::Enum XAxis, const Direction::Enum YAxis, const Direction::Enum ZAxis)
Output_GetDeviceName GetDeviceName(const unsigned int DeviceIndex) const
Output_GetSubjectRootSegmentName GetSubjectRootSegmentName(const String &SubjectName) const
Output_Disconnect Disconnect()
Output_IsConnected IsConnected() const
Output_GetSegmentChildCount GetSegmentChildCount(const String &SubjectName, const String &SegmentName) const
Output_GetSegmentGlobalRotationQuaternion GetSegmentGlobalRotationQuaternion(const String &SubjectName, const String &SegmentName) const
Output_GetSegmentName GetSegmentName(const String &SubjectName, const unsigned int SegmentIndex) const
Output_GetMarkerName GetMarkerName(const String &SubjectName, const unsigned int MarkerIndex) const
Output_GetSegmentGlobalRotationEulerXYZ GetSegmentGlobalRotationEulerXYZ(const String &SubjectName, const String &SegmentName) const
Output_GetSegmentGlobalTranslation GetSegmentGlobalTranslation(const String &SubjectName, const String &SegmentName) const
Output_GetVersion GetVersion() const
Output_GetSegmentLocalRotationHelical GetSegmentLocalRotationHelical(const String &SubjectName, const String &SegmentName) const
Output_GetLatencySampleValue GetLatencySampleValue(const String &LatencySampleName) const
int main(int argc, char *argv[])
Definition: ViconDump.cpp:81
Output_IsDeviceDataEnabled IsDeviceDataEnabled() const
Output_Connect Connect(const String &HostName)
Output_GetSegmentGlobalRotationHelical GetSegmentGlobalRotationHelical(const String &SubjectName, const String &SegmentName) const
Output_GetSegmentLocalRotationMatrix GetSegmentLocalRotationMatrix(const String &SubjectName, const String &SegmentName) const
Output_StopTransmittingMulticast StopTransmittingMulticast()
Output_IsSegmentDataEnabled IsSegmentDataEnabled() const
Output_SetStreamMode SetStreamMode(const StreamMode::Enum Mode)
Output_GetSubjectName GetSubjectName(const unsigned int SubjectIndex) const
Output_GetMarkerParentName GetMarkerParentName(const String &SubjectName, const String &MarkerName) const
Output_GetSegmentLocalTranslation GetSegmentLocalTranslation(const String &SubjectName, const String &SegmentName) const
Output_GetSegmentLocalRotationQuaternion GetSegmentLocalRotationQuaternion(const String &SubjectName, const String &SegmentName) const
Output_EnableMarkerData EnableMarkerData()
Output_GetSubjectCount GetSubjectCount() const
Output_GetMarkerCount GetMarkerCount(const String &SubjectName) const