Home
User Manual SpacePoint Fusion
Contents
1. the same time it is obtained This data can be imported into a spreadsheet if desired 6 2 Interpreting Fusion Game Pad Output The displayed and logged outputs have the same format as shown below The first line of output identifies the program the second line is the header line for the data and subsequent lines are the data Table 6 1 Sample Fusion Game Pad Log Output AX AY AZ QU Qi Q2 Q3 LButton RButton 0 9126 0 0837 0 1106 0 1061 0 6336 0 0611 0 7639 1 0 0 9126 0 0837 0 1106 0 1061 0 6336 0 0611 0 7639 1 0 0 9018 0 0782 0 1053 0 1059 0 6336 0 0616 0 7639 1 0 0 9018 0 0782 0 1053 0 1059 0 6336 0 0616 0 7639 1 0 0 9099 0 0837 0 1106 0 1055 0 6335 0 0621 0 7640 1 0 AX AY and AZ are the 3 axis normalized acceleration values in g QO Q1 Q2 and Q3 are the normalized quaternion values LButton and RButton represent the status of the module s buttons 1 is pressed 0 is not pressed PNI Sensor Corporation DOC 1015481 r01 SpacePoint Fusion User Manual June 2010 Page 14 of 25 SUNSTAR O DD O http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 7 Sample Code 7 1 FusionGamePad cpp The FusionGamePad cpp defines the entry point for the console application The
2. 2 q 3 sax sqy sqz sqw result pitch 180 PI asin 2 0 q 0 q 2 q 1 q 3 result roll 180 PI atan2 2 0 q 1 q 2 q 0 q 3 sqx sqy ses SQW I return result int main void iy 4 elements for the quaternions read from the SpacePoint Fusion float gq 314 Struct for the result struct ypr result 3D MagIC User Manual June 2010 Page 23 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con example input q 0 0 0055220 gl1 0 0278969 gGili 0 9983865 q 3 0 0491494 result q2ypr q example result Yaw Pitch Roll PEINCE Yaw VESEVENA 174 385117 0 788897 3 162396 printf Pith Nesta printf Ee te EE e ern result yaw result pitch result roll return 0 7 4 Quaternion to Euler Angles Matlab Often it is desirable to have outputs in Euler angles yaw pitch and roll rather than as quaternions The sample Matlab code provides an example for how to do this conversion function y p r a2ypr q Q2DCM Q converts a quaternion into heading y pitch p and roll r Inputs ql through q4 from SpacePoint Fusion in that order Ouputs Y P R sexample if nargin lt l q 1 0 0055220 q 2 0 0278969 q 3 049983865 q 4 0 04
3. furnishes an explanation of the deficiency ii such Product is returned to PNI s service facility at Customer s risk and expense and iii PNI is satisfied that claimed deficiencies exist and were not caused by accident misuse neglect alteration repair improper installation or improper testing If a Product is defective transportation charges for the return of the Product to Customer within the United States and Canada will be paid by PNI For all other locations the warranty excludes all costs of shipping customs clearance and other related charges PNI will have a reasonable time to make repairs or to replace the Product or to credit Customer s account PNI warrants any such repaired or replacement Product to be free from defects in material and workmanship on the same terms as the Product originally purchased Except for the breach of warranty remedies set forth herein or for personal injury PNI shall have no liability for any indirect or speculative damages including but not limited to consequential incidental punitive and special damages relating to the use of or inability to use this Product whether arising out of contract negligence tort or under any warranty theory or for infringement of any other party s intellectual property rights irrespective of whether PNI had advance notice of the possibility of any such damages including but not limited to loss of use revenue or profit In no event shall PNI s total liability for a
4. int ReadAsync void pBuf Buffer for storing bytes Read write handles While a single handle could suffice for both operations 2 handles have been created to allow the client application to utilize separate threads for reading and writing HANDLE ReadHandle HANDLE WriteHandle te tendif ifndef _ USBHID API H _ PNI Sensor Corporation DOC 1015481 r01 SpacePoint Fusion User Manual June 2010 Page 22 of 25 SUNSTAR 0 0 0 O http www sensor i c conh TEL 0755 83376549 FAX 0755 83376182 E MN L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 7 3 Quaternion to Euler Angles C Code Often it is desirable to have outputs in Euler angles yaw pitch and roll rather than as quaternions The sample C Code below provides an example for how to do this conversion include stdio h include stdlib h include math h define PI 3 14159265 This routine converts the q0 through q4 from the SpacePoint Fusion to Yaw Pitch and Roll Struct Yor float yaw loat pitch float roll y 7 aputsi Pointer to quaternion array q from the device Outputs Struct ypr containing Yaw Pitch and Roll results struct yor q ypr float q struct ypr result float sqx say sqz sqw sax q 0 q 0 sgy gl11 ql1 sqz q 2 q 2 saw q 3 q 3 result yaw 180 PI atan2 2 0 q 0 q 1 gq
5. sample code below demonstrates how to communicate with PNI s SpacePoint It is provided as is without any express or implied warranty include stdafx h include lt windows h gt include UsbHidApi h include lt math h gt include lt iostream gt using namespace std const int DATALEN 15 void displayindata unsigned char indata DATALEN int Nbytes int i byteindex 1 int rawaxes 14 float acc scaled 3 float q scaled 4 int buttons 2 Parse indata for i 0 i lt 7 i rawaxes i int indata byteindex 256 int indata byteindex 1 byteindex 2 buttons 0 indata byteindex amp 1 buttons 1 indata byteindex gt gt 1 amp 1 rawaxes 7 indata byteindex gt gt 4 amp 0xf 16 bit raw values centered at 32768 acc_scaled 6 acc received 32768 32768 for 1 0 1 lt 3 1 acc _scaled i 6 0f rawaxes i 32768 32768 0 printf 7 4f 4f 7 4f acc _scaled 0 acc scaled 1 acc scaled 2 16 bit raw values centered at 32768 q_scaled 3 0518e 005 qraw 32768 for 1 0 1 lt 4 1 q_scaled i 3 0518e 005f rawaxes 3 i 32768 printf 57 4 f 7 4 f 7 4 7 4f q scaled 0 q scaled 1 q scaled 2 q _scaled 3 printf 11 t 1i n buttons 0 buttons 1 3D MagIC User Manual June 2010 Page 15 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http
6. www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con int main int argc char argv int connected 0 int sample 0 int mode 0 int interfaceid 0 int Nbytes 0 int Nsamples 10 int VID 0x20ff int PID 0x0100 unsigned char indata DATALEN printf nPNI Corp Fusion Game Pad data logger V3 00 n if argc 2 amp amp arge 4 cout lt lt nusage FusionGamePad Nsamples lt VID 8447 0x20ff gt lt PID 256 0x0100 gt n lt lt endl else Nsamples atoi argv 1 if argc gt 2 VID atoi argv 2 PID atoi argv 3 ILEGUE lt lt VID lt lt NEW lt lt PID lt lt endi SetInterface 1 printf n AX AY DAs QO Ol 02 Q3 LButton RButton n if connected Open VID PID NULL NULL NULL 1 printf Connected n sample 0 while connected if sample lt Nsamples if Noytes Read indata gt 0 displayindata indata Nbytes sample else CloseRead connected 0 return 0 PNI Sensor Corporation DOC 1015481 r01 SpacePoint Fusion User Manual June 2010 Page 16 of 25 SUNSTAR O O 0O 0O http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 7 2 UsbHidApi h This DLL provides the client application an easy method for accessing
7. 91494 end sqx q 1 q 1 say a 2 a 2 sqz q 3 q 3 sqw q 4 q 4 ER example result ER olo kg ll ole 1 743851191837815e 002 0 788896841796396 olo IO ER ER Y 3 16259584665 551 PNI Sensor Corporation DOC 1015481 r01 SpacePoint Fusion User Manual June 2010 Page 24 of 25 SUNSTAR 0 0 0 O http www sensor i c conh TEL 0755 83376549 FAX 0755 83376182 E MN L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 180 pi atan2 2 0 q 1 q 2 qa 3 q 4 sax say sqz sqw p 80 pi asin 2 0 qa 1 9q 3 q 2 9 4 r 180 pi atan2 2 0 q 2 q 3 q 1 q 4 sqx sqy sqz sqw end 3D MaglC User Manual June 2010 Page 25 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con
8. NSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con extern C void _stdcall ShowVersion void Show a message box containing version extern C int _stdcall Read void pBuf Read the from the HID device extern C void _stdcall CloseRead void if Close the read pipe extern C void _stdcall CloseWrite void Close the write pipe extern C int stdcall Write void pBuf Write to the HID device extern C void _stdcall GetReportLengths int input len Pointer for storing input length int output_len Pointer for storing output length extern C void _stdcall SetCollection int Specifies a collection call prior to Open Oxffff unspecified extern C int _stdcall GetCollection Retrieves collection setting 0xffff unspecified extern C void _stdcall SetInterface int if Specifies an interface call prior to Open Oxffff unspecified extern C int _stdcall GetInterface Rerieves interface setting Oxffff unspecified extern C int _stdcall Open unsigned int VendorID Vendor ID to search Oxffff if unused unsigned int ProductID Product ID to search Oxffff if unused char Manufacturer Manufacturer NULL if unused char SerialNum fi Serial number to search 0xffff if unused char DeviceName Device name to search NULL if unused int bAsync Set TRUE for no
9. SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con User Manual SpacePoint Fusion Demonstration Motion Tracking Module Pon SENSOR CORPORATION SUSTAR O 0 O O http www sensor i c com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con Table of Contents 1 COPYRIGHT 8 WARRANTY INFORMATION aeauanananananananananananananananawa 3 2 INTRODUGTION ea i r add ay ta PO iiss Pod KO wad ete 4 3 GETTING STARTED cc a a aw O ka ad AAA DAR 5 4 USING THE DEMO PROGRAMS sssssaa aaa nana nana nana nana an ananas Sen 6 4 1 GETTING STARTED WITH THE DEMO PROGRAMS oococcccncnonininicinininininan 6 4 2 FUSIONPOINTER DEMO PROGRAM as asa sara saa as ab aaa aa aa aa az az az az acac 7 4 3 SEAGULL ISLAND DEMO PROGRAM aa aa aaa aaa aaa aa aaaaaaaaaazazazaaa 7 5 INTERPRETING SPACEPOINT FUSION S OUTPUT ees keen 9 6 FUSION GAME PAD SAMPLE PROJECT 8 DATA LOGGER 11 6 1 RUNNING FUSION GAME PAD DATA LOGGER coccccccncncncnccinininininininininanos 12 6 2 INTERPRETING FUSION GAME PAD OUTPUT 00occcccoconocononcnononcnoncncnnnnonos 14 7 SAMPLE CODE aiii donna e clan CA ka ELA A AAA 15 7 1 FUSIONGAMEDAD CPP 15 7 2 WSBHIDAPIIA a od id Add 17 7 3 QUATERNION TO EULER ANGLES CODE 23 7 4 QUATERNION TO EULER ANGLES MA
10. TLAB oococccococonononinininininininininass 24 List of Tables Table 5 1 Gelee ie e EE 9 Table 5 2 Sample Endpoint Output 10 Table 6 1 Sample Fusion Game Pad Log Output 14 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 1 Copyright 8 Warranty Information Copyright PNI Sensor Corporation 2010 All Rights Reserved Reproduction adaptation or translation without prior written permission is prohibited except as allowed under copyright laws Revised June 2010 for the most recent version visit our website at www pnicorp com PNI Sensor Corporation 133 Aviation Blvd Suite 101 Santa Rosa CA 95403 USA Tel 707 566 2260 Fax 707 566 2261 Warranty and Limitation of Liability PNI Sensor Corporation PNI manufactures its Products from parts and components that are new or equivalent to new in performance PNI warrants that each Product to be delivered hereunder if properly used will for ninety 90 days following the date of shipment unless a different warranty time period for such Product is specified i in PNI s Price List in effect at time of order acceptance or ii on PNI s web site www pnicorp com at time of order acceptance be free from defects in material and workmanship and will operate in accordance with PNI s published specifications and documentatio
11. an HID device via USB link The acts of reading from and writing to a USB device under Windows are significantly different and more involved than for other communication devices such as serial comm ports For this reason PNI has encapsulated the complexity of the interface within a DLL This DLL provides all the required functions for accessing the device while hiding the details of the implementation The USB link is implemented as a Human Interface Device HID class function As such the DLL is dependent on the following Windows drivers e hidclass sys e hidparse sys e hidusb sys In addition to being USB compliant the host PC should have the latest versions of the drivers listed above The module was built using Microsoft Visual C 6 0 as a Win32 non MFC DLL Since there is no dependence on the Microsoft Foundation Class MFC there is no need to copy additional MFC DLLs to your Windows system folder Also no dependence on MFC means the size of the DLL itself is minimal Although the DLL does not internally use the MFC the client application is not restricted Exported functions in the DLL may be called by either MFC or non MFC applications The client application may link implicitly or explicitly with the DLL In explicit linking the client application makes function calls to explicitly load and unload the DLL s exported functions In implicit linking the application links to an import library UsbHidApi lib and makes functi
12. an be used to display or log sensor or calculated data from the module The overall project folder can act as a guide for generating new programs that utilize the SpacePoint Fusion demonstration module Note that Fusion Game Pad was developed on a Windows XP platform To view the source code in native format Visual C Express can be downloaded at www microsoft com express vc Conversely much of the source code is provided in hardcopy format in Section 7 The key resources and source code in this project are e FusionGamePad cpp e UsbHidApi h e UsbHidApi dll e UsbHidApi lib 3D MagIC User Manual June 2010 Solution Explorer Fusionga es la A Solution Explorer FusionG al Solution FusionGamePad 1 pro sa Gi Header Files h stdaf ch Hl targetver h Lh UsbHidapi h o Gy Resource Files a UsbHidApi lib GO Source Files C FusionGamePad cpp C stdafx cpp E ReadMe txt KI d Visual C Tree Page 11 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DDT http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con FusionGamePad cpp is the main source code to read data from the module s USB interface This data can be output to the display or logged to a text file Hardcopy source code is provided in Section 7 1 UsbHidApi h includes the UsbHidApi library function
13. ductID Product ID Sg InputReportLen Length of HID input report bytes int OutputReportLen Length of HID output report bytes int Interface Interface int Collection Collection mdeviceList This structure was created to ease VB access It alleviates some of the issues associated with inter compiler data handling such as alignment added 3 8 05 pragma pack push 4 typedef struct char DeviceName Device name char Manufacturer Manufacturer char SerialNumber Serial number unsigned int VendorID Vendor ID unsigned int ProductID Product ID int InputReportLen Length of HID input report bytes LM OutputReportLen Length of HID output report bytes int Interface Interface int Collection Collection mdeviceList2 pragma pack pop 4 TALE TTA EL ALT TAAL LAA AAAD AAN IA ARA CARA ARA LAA TAAL ELTA AAT TTD TAT TAI AI LLULLU LIAU ADS These declarations define special non member functions for VB access DEFEAT TEL LTT AT TAA AAA TAT AT ET AA AL AAT AAT AA AT AA CIUTACU LLULLA TAALI extern C int _stdcall SetInstance int instance Set object instance extern C int _stdcall GetLibVersion char buf Get DLL version string PNI Sensor Corporation DOC 1015481 r01 SpacePoint Fusion User Manual June 2010 Page 18 of 25 SUNSTAR 0 0 0 O http www sensor i c conh TEL 0755 83376549 FAX 0755 83376182 E MN L szss20G163 con SU
14. e Button status and PNI reserved data fields also are reported Data is updated and output at 125 Hz and all data is in hex format The 15 bytes of data on endpoint 0x82 is presented in little Endian format as follows Table 5 1 Endpoint Outputs Byte Description 0 Scaled Accel X Lower Scaled Accel X Upper Scaled Accel Y Lower Scaled Accel Y Upper Scaled Accel Z Lower Scaled Accel Z Upper Quaternion 0 Lower Quaternion 0 Upper oo dl O O Si Gol N gt Quaternion 1 Lower 9 Quaternion 1 Upper 10 Quaternion 2 Lower 11 Quaternion 2 Upper 12 Quaternion 3 Lower scalar 13 Quaternion 3 Upper scalar 14 Reserved Button The status of the module s left and right buttons are packed into the 14 byte The least significant bit LSB is the left button and the second LSB is the right button 3D MaglC User Manual June 2010 Page 9 of 25 SUNSTAR O O OO http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con Table 5 2 Sample Endpoint Output Data stream 2f85238a5b90ac9f496a1 26a 1ef8d0 Raw Data 2f 85 23 8a 5b 90 ac 9f 49 Ga 12 6a le f8 dO SEN Scaled Scaled Scaled Res De
15. erform blocking or non blocking reads Refer to Open for details On success the call returns the number of bytes actually read A negative return value indicates an error most likely means the USB cable has been disconnected or device was powered off Note The first byte location is usually a report ID typically 0 The caller must account for this value in the read buffer int Read void pBuf Buffer for storing bytes Write a report to the HID device The number of bytes to write depend on the output report length specified by the device Returns number of bytes actually written A negative return value indicates an error most likely means the USB cable has been disconnected or device was powered off Note The first byte location is usually a report ID 3D MaglC User Manual June 2010 Page 21 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con typically 0 The caller must ensure this value is prepended to the buffer int Write void pBuf Buffer containing bytes to write This function retrieves the lengths of input and output reports for the device These values determine the I O lengths for the Read and Write functions The device must be opened prior to calling th
16. heck under Game Controllers on the Control Panel where it should be recognized as a 7 axis 2 button device Here under Properties you should observe changes in the 7 axis states as the device is moved although these 7 states are not correlated to their description That s about it The device now will be streaming orientation data in the form of quaternions to your computer via the USB HID interface Things you can do next include e Runa PNI demo program to demonstrate the performance of the SpacePoint Fusion demonstration module and have a little fun Two web based Unity demo programs are available at PNI s website and instructions for how to use these are found in Section 4 of this manual e Observe or log sensor data or calculated orientation data PNI s Fusion Game Pad program allows you to do this and can be downloaded at PNI s website Instructions for logging data using the Fusion Game Pad program are found in Section 6 e Develop code to integrate the SpacePoint Fusion demonstration module s output into your application Section 5 includes an explanation of the streaming data at the USB HID interface while Section 7 provides sample hard copy source code Additionally PNI s Fusion Game Pad project found on PNI s website provides a complete Visual C program to leverage 3D MaglC User Manual June 2010 Page 5 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L
17. hen continues on a straight course you ll soon be viewing it from behind again Likewise pressing the left button to go faster causes the seagull to move well ahead of you and releasing the left button allows you to catch up As previously mentioned the Seagull Island program primarily is intended for entertainment purposes by providing an intuitive feel for gameplay But since it couples both heading and roll to control the seagull s orientation it does not demonstrate the absolute orientation capabilities of SpacePoint technology as effectively as the FusionPointer demo program PNI Sensor Corporation DOC 1015481 r01 SpacePoint Fusion User Manual June 2010 Page 8 of 25 SUNSTAR OD O 0O 0O http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 5 Interpreting SpacePoint Fusion s Output The SpacePoint Fusion demonstration module is a USB composite device with HID Game Pad Report output on endpoint 0x82 The Game Pad Report includes 15 bytes of data For additional information regarding USB refer to the USB 2 0 specification and the USB HID specification The output includes scaled acceleration values converted into g s and orientation values given as quaternions These are calculated from sensor data using PNI s proprietary Spacepoint algorithm which is embedded in the module s firmwar
18. is routine Alternatively you can just use m ReadSize and m WriteSize void GetReportLengths int input len Pointer for storing input length int output_ len Pointer for storing output length This function retrieves the current library version and populates a string int GetLibVersion LPSTR buf This function displays the current library version in a standard message box void ShowVersion void Private internal declarations private This function reads an input report from an open device The call will block until any number of bytes is retrieved up to the maximum of nBytesToRead On successful completion the function returns an integer representing the number of bytes read usually the input report length defined by the device Note The read buffer must be large enough to accommodate the report length This number is located in m ReadSize int ReadSync void pBuf Buffer for storing bytes Read input report from an open device If no data is currently available the call will not block but will return 0 On successful completion the function returns an integer representing the number of bytes read usually the input report length defined by the device The function returns 1 if disconnect is detected Note The read buffer must be large enough to accommodate the report length This number is located in m ReadSize
19. ll claims regarding a Product exceed the price paid for the Product PNI neither assumes nor authorizes any person to assume for it any other liabilities Some states and provinces do not allow limitations on how long an implied warranty lasts or the exclusion or limitation of incidental or consequential damages so the above limitations or exclusions may not apply to you This warranty gives you specific legal rights and you may have other rights that vary by state or province 3D MaglC User Manual June 2010 Page 3 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 2 Introduction Thank you for purchasing PNI Sensor Corporation s SpacePoint Fusion demonstration motion tracking module We re certain you Il be impressed with its incredibly accurate and repeatable tracking performance and its low latency The SpacePoint Fusion module is intended for demonstrating the capabilities of PNI s SpacePoint motion tracking technology The module incorporates a 3 axis accelerometer 3 axis gyroscope and 3 axis magnetometer These 9 outputs are internally processed using PNI s SpacePoint algorithm to provide calculated orientation data in the form of quaternions The USB HID interface seamlessly integrates with a user s system to provide calculated quaternion orientation data Becau
20. n blocking read requests extern C int _stdcall GetList unsigned int VendorID Vendor ID to search Oxffff if unused unsigned int ProductID Product ID to search 0xffff if unused char Manufacturer Manufacturer NULL if unused char SerialNum Serial number to search NULL if unused char DeviceName Device name to search NULL if unused 3D MaglC User Manual June 2010 Page 19 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con mdeviceList2 pList Caller s array for storing matching device s ine of the caller s array list no entries This class is exported from class USBHIDAPI API CUsbHidApi public The serial number for th char m SerialNumber 20 open devic These variables define th the device unsigned short m ReadSize unsigned short m WriteSize 24 nMaxDevices Size the UsbHidApi dll required lengths for reading and writing These variables define optional interface and or collection values search purposes added 3 12 07 int m Interface int m Collection Constructor CUsbHidApi void Destructor CUsbHidApi void Get list of devices pointer to a buffer Must also supply an his buffer can hold int GetList unsigned in
21. n for the Product in effect at time of order PNI will make no changes to the specifications or manufacturing processes that affect form fit or function of the Product without written notice to the Customer however PNI may at any time without such notice make minor changes to specifications or manufacturing processes that do not affect the form fit or function of the Product This warranty will be void if the Products serial number or other identification marks have been defaced damaged or removed This warranty does not cover wear and tear due to normal use or damage to the Product as the result of improper usage neglect of care alteration accident or unauthorized repair THE ABOVE WARRANTY IS IN LIEU OF ANY OTHER WARRANTY WHETHER EXPRESS IMPLIED OR STATUTORY INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF MERCHANTABILITY FITNESS FOR ANY PARTICULAR PURPOSE OR ANY WARRANTY OTHERWISE ARISING OUT OF ANY PROPOSAL SPECIFICATION OR SAMPLE PNI NEITHER ASSUMES NOR AUTHORIZES ANY PERSON TO ASSUME FOR IT ANY OTHER LIABILITY If any Product furnished hereunder fails to conform to the above warranty Customer s sole and exclusive remedy and PNI s sole and exclusive liability will be at PNI s option to repair replace or credit Customer s account with an amount equal to the price paid for any such Product which fails during the applicable warranty period provided that i Customer promptly notifies PNI in writing that such Product is defective and
22. on calls just as if the functions were contained within the executable ifndef _ USBHID API H define _ USBHID API H define USBHIDAPI DLL NAME UsbHidApi dll The following ifdef block is the standard way of creating macros which make exporting from a DLL simpler All files within this DLL are compiled with the USBHIDAPI EXPORTS symbol defined on the command line this symbol should not be defined on any project that uses this DLL This way any other project whose source files include this file see USBHIDAPI API functions as being imported from a DLL whereas this DLL sees symbols 3D MagIC User Manual June 2010 Page 17 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con defined with this macro as being exported ifdef USBHIDAPI EXPORTS define USBHIDAPI API declspec dllexport felse define USBHIDAPI API declspec dllimport fendif This structure defines an entry in a device list The list describes the parameters associated with a device It is mainly used with the GetList 74 funetio modified 3 12 07 typedef struct char DeviceName 50 Device name char Manufacturer 50 Manufacturer char SerialNumber 20 Serial number unsigned int VendorID Vendor ID unsigned int Pro
23. s Hardcopy source code is provided in Section 7 2 6 1 Running Fusion Game Pad Data Logger Instructions for running Fusion Game Pad follow Note it is important to ensure the SpacePoint Fusion demonstration module is fully at rest for 5 seconds when plugging it into the computer s USB port as the gyros initialize during this time e Open a Command window Click on Start then Run 5 5 D A Ei rd Administrator e Internet c My Documents Internet Explorer My Recent Documents gt Ca E mail E Y Ce Outlook Express a ia O Pictures Microsoft Visual C f 2008 Express Edition _ Music 3 My Computer 4 Unity a My Network Places OONN p wb bh KK o Oa 0 0 Y Y JOY CRG W M A A a Z ETA A JR RRC l cH Microsoft visual Ci 2008 Express Edition D Control Panel fa Notepad Set Program Access and Defaults a gt det e 44 Remote Desktop Connection Ka Printers and Faxes TRE Wees SH 2008 Command Help and Support romp K USB Hid Demo All Programs gt Log off TO Turn OFF Computer EA spacePointvCpp Vis Yisan2 Development PNI Sensor Corporation DOC 1015481 r01 SpacePoint Fusion User Manual June 2010 Page 12 of 25 SUNSTAR 0 0 0 O http www sensor i c conh TEL 0755 83376549 FAX 0755 83376182 E MN L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con This
24. scription AccelX AccelY Accelz 110 alt ql2 al Bo B1 Hex 852f 8a23 905b fac 6a49 6a12 f81e do Decimal 34095 35363 36955 40876 27209 27154 63518 Offset 32768 32768 32768 32768 32768 32768 32768 Counts 1327 2595 4187 8108 5559 5614 30750 Scale Factor 6 6 6 1 1 1 1 Scaled 7962 15570 25122 8108 5559 5614 30750 Counts Normal 32768 32768 32768 32768 32768 32768 32768 Factor Value 0 2430 0 4752 0 7667 0 2474 0 1697 0 1713 0 9384 Where e Offset the middle of the sensor s total range or 32768 e Counts Dec Offset e Scale Factor the g rating of the accelerometer e Scaled Counts Counts Scale Factor e Normal Factor the normalization factor for the sensor or 32768 e Value Scaled Counts Normalization Factor PNI Sensor Corporation DOC 1015481 r01 SpacePoint Fusion User Manual June 2010 Page 10 of 25 SUNSTAR O 0 O O http www sensor i c com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 6 Fusion Game Pad Sample Project 6 Data Logger The FusionGamePad zip file includes a complete Visual C project with a functioning build in the Release folder The Release folder is created when the zip file is extracted The executable file in the Release folder c
25. se dotnetx35setup exe to install this package if it is not already installed This can be downloaded at http msdn microsoft com en us netframework cc378097 aspx If it does not install correctly uninstall all versions of Microsoft NET Framework then try again Demo programs are available at www pnicorp com support downloads spacepoint fusion Download the desired demo program s zip file and extract it Plug the SpacePoint Fusion demonstration module into the computer s USB port prior to launching the demo program It is important that the module is fully at rest for 5 seconds after plugging it into the computer s USB port as the gyros initialize during this time Once the module is connected to the USB port its red and green LEDs will light up Launch a demo program by double clicking the program s html icon With the program running point the module at your computer display and press P on your keyboard to set the viewpoint You can reset the rendered viewpoint at anytime by pressing P again In the upper left corner of the screen you will see a box containing a series of numbers The row labeled q displays the instantaneous calculated quaternion values the row labeled acc displays the calculated acceleration values in g for each axis while acc magnitude is the magnitude of the acceleration vector 1 0 g when the module is at rest PNI Sensor Corporation DOC 1015481 r01 SpacePoint F
26. se the SpacePoint Fusion demonstration module incorporates a USB HID interface no drivers are necessary and no batteries are required since the host computer powers the module via the USB port PNI Sensor Corporation DOC 1015481 r01 SpacePoint Fusion User Manual June 2010 Page 4 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 3 Getting Started To use the SpacePoint Fusion demonstration module simply plug it into your computer s USB port It is important to ensure the module is fully at rest for 5 seconds when plugging it into the computer s USB port as the gyros initialize during this time Once the module is connected to the USB port its red and green LEDs will light up If using Windows and this is the first time plugging in a SpacePoint Fusion demonstration module Windows will automatically launch the Found New Hardware wizard then indicate it has found the module and install the device If the LEDs do not come on or Windows otherwise does not seem to recognize the device check the Device Manager under Universal Serial Bus Controller USB Composite Device The SpacePoint Fusion demonstration module should be identified with Location 0 SpacePoint Fusion and under the Details tab it should indicate VID_20FF amp PID_0100 Alternatively you can c
27. szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 4 Using the Demo Programs PNI provides two demo programs that work with the SpacePoint Fusion demonstration motion tracking module These are the FusionPointer and Seagull Island programs They are web based Unity programs which have been shown to run on Windows XP Windows Vista Windows 7 and Macintosh OX operating systems and should work on Linux systems As these programs are free and principally intended to demonstrate the possibilities enabled with PNI s SpacePoint technology no guarantees are made regarding their ability to operate on any specific computer configuration Also note that performance can vary depending on the computer s graphics card The FusionPointer demo is well suited for demonstrating the capabilities of SpacePoint technology while the Seagull Island demo is more for entertainment This is because the FusionPointer demo provides an orientation rendering mode mimic mode and a pointing mode both of which provide absolute orientation referencing In contrast the Seagull Island demo couples both heading and roll to control the seagull s orientation which provides an intuitive feel for gameplay but sacrifices the inherent absolute orientation aspect of SpacePoint technology 4 1 Getting Started with the Demo Programs For Windows computers ensure Microsoft s NET Framework is installed Please u
28. t ID to search Oxffff if unused char Manufacturer Manufacturer NULL if unused char SerialNum Serial number to search Oxffff if unused char DeviceName Device name to search NULL if unused int bAsync Set TRUE for non blocking read requests Sets an optional device interface ID e g 0 for search purposes This method is used to pin point a device to be opened Use this method when a USB device has multiple interfaces Must be called prior to calling the Open method added 3 12 07 void SetInterface int iface Interface 1 if unused Returns the device interface ID that was set using SetInterface added 3 12 07 int GetInterface void Sets an optional collection ID e g 0 for search purposes This method is used to pin point a device to be opened Use this method when a USB device has multiple collections Must be called prior to calling the Open method added 3 12 07 void SetCollection int col Collection 1 if unused Returns the collection ID that was set using SetCollection added 3 12 07 int GetCollection void Close the read pipe void CloseRead void Close the write pip void CloseWrite void Read the from the HID device The number of bytes read is determined by the input report length specified by the device Depending on how the device was opened the call may p
29. t VendorID if unused unsigned int ProductID if unused char Manufacturer NULL if unused char SerialNum L NULL if unused char DeviceName fi NULL if unused mdeviceList pList matching device s int nMaxDevices list no entries Opens a USB comm link to a HID device on success or 0 on failure TE th and their availability that will hold the list of structure entries integer representing maximum no Returns total number stored Caller must supply a of entries Vendor ID to search Oxffff Product ID to search Oxffff Manufacturer Serial number to search Devic to search nam Caller s array for storing Size of the caller s array Returns non zero Individual read and write handles are maintained internally a specific HID device specifiers i e or device name returns TRUE It returns FALSE int Open unsigned int VendorID Oxffff if unused he must provide vendor ID product ID If a successf PNI Sensor Corporation SpacePoint Fusion User Manual June 2010 ul open occurs otherwise caller desires to open one or more serial number the function Vendor ID to search DOC 1015481 r01 Page 20 of 25 SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con unsigned int ProductID Produc
30. tick is set by how far the image is zoomed out PNI generally recommends fully zooming out on the object making it as small as possible when operating in Pointer mode The program will start in Mimic mode To temporarily switch to Pointer mode hold down the left button when the left button is released the program will be back in Mimic mode To semi permanently put the module in Pointer mode double click the left button To exit Pointer mode press the left button once 4 3 Seagull Island Demo Program The Seagull Island program is a 3 person game in which the player controls the flight of a seagull around an island A few points about the program To turn the seagull you can either turn the module in the horizontal plane adjust yaw or you can roll the module around its X axis similar to banking an airplane To go faster press the module s left button Pressing the right button has no effect The 3 person eye acts as though it is attached to an elastic cord which is attached to the seagull at the other end Consequently when you start you ll see the seagull from behind When the seagull turns you ll see the seagull from a different viewpoint but if the seagull 3D MagIC User Manual June 2010 Page 7 of 25 SUNSTAR O 0D OO http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con t
31. usion User Manual June 2010 Page 6 of 25 SUNSTAR O O OO http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con 4 2 FusionPointer Demo Program The FusionPointer program provides a 3 D rendering of the SpacePoint Fusion demonstration module By simultaneously pressing the module s right button and twisting the module about its X axis you can zoom in or out on the rendered image i e the image can be enlarged or shrunk The FusionPointer program operates in either Mimic or Pointer mode as described below e Mimic Mode In Mimic mode the image can be rotated about its center such that the rendered module will closely mimic the orientation of the module This assumes the viewpoint is initially aligned by pressing the P button when pointing straight at the screen e Pointer Mode In Pointer mode the image on the screen acts as if it were attached by a stick to the module such that changing the orientation of the module results in the image translating on the screen When operating in Pointer mode the image will have a bright red superimposed over it Note that the image only responds to changes in orientation and not changes in position Since the rendered image does not know the actual distance of the SpacePoint Fusion demonstration module from the screen the length of the virtual s
32. will open the Run window Type cmd then press lt enter gt Type the name of a program Folder document or Internet resource and Windows will open it For you Open cmd This will open the Command window icrosoft Windows AP Version 5 1 26688 lt C Copyright 1985 2661 Microsoft Corp SS Ba In the Command window type cd file path to set the directory to the Release folder where FusionGamePad exe resides cx C WINDOWS system32 cmd exe Dis E Microsoft Windows AP Uersion 5 1 2600 lt C Copyright 1985 2661 Microsoft Corp C gt cd Nprogram files fusiongamepad re lease C Program Files FusionGamePadNRe lease gt 3D MaglC User Manual June 2010 Page 13 of 25 SUNSTAR DT http www sensor ic co TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con SUNSTAR DIDD http www sensor ic com TEL 0755 83376549 FAX 0755 83376182 E MA L szss20G163 con e Run the executable file In the Command window and in the Release directory type the following FusionGamePad exe Nsample This will display the results on the computer screen To store the data to a log file use the pipe command gt gt as in the example below FusionGamePad exe 100 gt gt test log This creates a file named test log with calculated orientation data from 100 samples and this file will be saved in the Release folder The data will not be displayed at
Download Pdf Manuals
Related Search
Related Contents
Manual de Usuario SIP y SINVP Nobo 1903848 SD-370EKE - Migros manual Deutsches INES KDC-BT6544U KDC-BT6544UY KDC-BT6044 KDC XIA Handel library Copyright © All rights reserved.
Failed to retrieve file