Instruction Manual for ps-tech models including: PST Classic SDK
ation | PS-Tech
1.4. Headerpstapi.h id int Identifierofthe3Dpoint. Asasingle3Dpoint hasnofeaturestodistinguishitfromanother, points are given an identifier based on their previous ...
PST Classic SDK Manual PS-Tech B.V. Falckstraat hs NL VV Amsterdam The Netherlands Call: + ( ) Fax : + ( ) info@ps-tech.com http://www.ps-tech.com While every precaution has been taken in the preparation of this manual, PS-Tech B.V. assumes no responsibility for errors or omissions. Copyright © by PS-Tech B.V., Amsterdam, the Netherlands All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, photocopying, recording or otherwise, without the prior written permission of PS-Tech B.V. PS-Tech, the PS-Tech logo, PST, PST Iris (HD), PST Base (HD) and PST Pico are either registered trademarks or trademarks of PS-Tech in the United States and/or other countries. Rev. . . - -gd d de Legal License agreement The products of PS-Tech B.V. (PS-Tech) come with a so tware license agreement. This END USER LICENSE AGREEMENT (EULA) is shipped with each product, and is available on request at the o fices of PS-Tech B.V. In no event shall PS-Tech be held liable for any incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the so tware or hardware. Patent liability No patent liability is assumed with respect to the use of the products of PS-Tech B.V. Copyright information Portions of the so tware included in this package contain licensed third-party technology. With some of these, you also may have additional rights, particularly to receive source code of these projects. The LDL and COLAMD libraries of the SuiteSparse project are licensed under the GNU LGPL. The SSBA library is licensed under the GNU LGPL. This so tware is based in part on the work of the FLTK project. The DevIL library is licensed under the GNU LGPL. The relevant third-party licenses are included in the license.txt file in your PST installation. Please contact PS-Tech to obtain source copies of these libraries. ii Contents Legal ii License agreement . . . . . . . . . . . . . . . . . . . . . . . . . . ii Patent liability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii Copyright information . . . . . . . . . . . . . . . . . . . . . . . . . ii So tware development kit . Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Datatype: PSTSensor . . . . . . . . . . . . . . . . . . . . . . . Datatype: PSTPoint . . . . . . . . . . . . . . . . . . . . . . . . Header pstapi.h . . . . . . . . . . . . . . . . . . . . . . . . . . Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii So tware development kit The Classic PST So tware Development Kit (Classic SDK) provides an interface between the PST tracking system and your own so tware applications. Note that with the release of the new PST SDK in version . . of the PST so tware package, the Classic PST SDK is labeled as legacy so tware and is only o fered for backwards compatibility. When a new project making use of the PST tracking system is started it is highly recommended to use the new PST SDK. Documentation for the new PST SDK can be found in the Start menu as "PST SDK Manual" or can be opened by opening the "index.html" file in the "Development/docs" directory in the installation path. . Usage To use the Classic PST SDK in your own so tware, include the header file "pstapi.h" in your project. The Classic PST SDK library is dynamically (pst.lib/pst.dll or pst.so) or statically (pst.a) linked with your program. Note that the Classic PST SDK communicates with the PST client so tware that is included with your PST installation. If this application is not running you will not receive tracker events in your application, even if the tracker unit itself is running. The Classic PST SDK contains two data types to describe tracker data events: Psr and PPt. . Datatype: PSTSensor Description PSTSensor sensor events are generated when a tracking target is visible and has been identified by the PST. . . Datatype: PSTPoint Member documentation name r Name of the tracking target as listed in the PST client so tware. id t Identifier of the tracking target as listed in the PST client so tware. pose t Row-major × transformation matrix de- scribing the pose of the tracking target in the coordinate system as defined in the PST client so tware (see the "Reference coordinate sys- tem" Section in the PST Manual). The pose is defined as: p0 p1 p2 p3 Ux Vx Wx Tx p4 p8 p5 p9 p6 p10 p7 p11 = Uy Uz Vy Vz Wy Ty Wz Tz p12 p13 p14 p15 00 0 1 where pi represents the elements from the pose, the vectors U , V , W represent the × rotation matrix in radians, and T represents the translation vector in meters. timestamp Timestamp of the moment the cameras captured the data. The timestamp uses the system clock provided in seconds since system boot (Windows) or Epoch (Linux). . Datatype: PSTPoint Description Point events are generated for single visible D points that have not been identified as part of an tracking target. Member documentation . . Header pstapi.h id pos timestamp t t Identifier of the D point. As a single D point has no features to distinguish it from another, points are given an identifier based on their previous motion. Note that there is no guarantee that the identifier is consistent between sensor updates. The D position of the point in meters. Timestamp of the moment the cameras captured the data. The timestamp uses the system clock provided in seconds since system boot (Windows) or Epoch (Linux). . Header pstapi.h Description The interface to the PST client so tware. Function documentation t stt Connect to the PST Return value t One on success, zero on failure t stst Disconnect from the PST Return value t One on success, zero on failure t stssr Check if any PST sensor has been updated since the last time it was read by the SDK Parameters The identifier of the device ( - ) Return value t One if new data is available, zero if no new data is available t stssrt Check if the PST sensor indicated by has been updated since the last time it was read by the SDK Parameters The identifier of the device ( - ) Return value t One if new data is available, zero if no new data is available . . Example t sttssrstrt Psr ssr Get the last PST sensor event if a new event is available Parameters ssr A pointer to an allocated PSTSensor struct to re- ceive a new event Return value t One if a new event is returned, zero if no new data is available t sttssrt strt Psr ssr Get the last PST sensor event with the given id if a new event is available Parameters The identifier of the device ( - ) ssr A pointer to an allocated Psr struct to re- ceive a new event Return value t One if new data is available, zero if no new data is available t stt Check if any PST point has been updated since the last time it was read by the SDK Return value t One if a new point is available, zero if no new point is available t stttstrt PPt t Get the last PST point event if a new event is available Parameters A pointer to an allocated PSTPoint struct to receive a new event Return value t One if a new point is available, zero if no new point is available t stttsttt stt Get the connection state of the SDK to the PST client Parameters stt A pointer to an int. A ter the call returns success- fully, stt will be set to one if a connection is active, zero otherwise. Return value t One if the state was received successfully, zero otherwise . Example #include #include #include #include < stdio .h> <math . h> < stdlib .h> " pstapi .h" . . Example int main ( int argc , char ** argv ) { int i , j ; struct PSTSensor sensor ; / / connect to the PST if (! pst_connect ()) exit ( ); // infinite loop ... while ( ) { / / l o o p o v e r a l l new s e n s o r e v e n t s while ( pst_get_sensor (& sensor ) ) { / / p r i n t out the name and i d p r i n t f ( " D e v i c e : \ " % s \ " , i d : %d \ n " , s e n s o r . name , s e n s o r . i d ) ; // print the rotation matrix printf ( " Orientation :\n" ); for ( i = ; i < ; ++ i ) { printf ( " " ); for ( j = ; j < ; ++ j ) p r i n t f ( " %. f " , sensor . pose [ i * + j ] ) ; printf ( " \n" ); } // print the translation vector printf ( " \n Translation :\n " ); for ( i = ; i < ; ++ i ) p r i n t f ( " %. f " , sensor . pose [ i * + ] ) ; printf ( " \n\n" ); } } / / d i s c o n n e c t from the PST pst_disconnect (); return ; } . . ExampleMiKTeX pdfTeX-1.40.21 LaTeX with hyperref