Home

The 5DT Data Glove Driver

image

Contents

1. Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen pUpper and pLower Arrays of 16 bit unsigned integers that will contain the maximum and minimum raw sensor values The size of each array must always match the value returned by fdGetNumSensors Refer to section 6 for details Remarks None void fdGetCalibration fdGlove pFG int nSensor unsigned short pUpper unsigned short pLower Obtains the current auto calibration settings of the driver for a specific sensor Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen nSensor Index of the sensor that is being set The value must lie in the range given by the enumerated type EfdSensors or alternatively from zero to the value returned by fdGetNumSensors minus one pUpper and pLower Pointers to 16 bit unsigned integers containing the maximum and minimum raw sensor values Refer to section 6 for details Remarks None void fdSetCalibrationAll fdGlove pFG unsigned short pUpper unsigned short pLower 10 Resets the current auto calibration settings of the driver to user defined values Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen pUpper and pLower Arrays of 16 bit unsigned integers containing the maximum and minimum raw sensor values The size of each array must always match the valu
2. 0 0 Ring finger point 3 4 5 0 1 0 1 Ring index point 3 5 6 0 1 1 0 Ring middle point 3 6 ag 8 1 0 0 0 Little finger point 3 8 9 1 0 0 1 Howzit 3 9 10 1 0 1 0 Little middle point 3 10 11 1 0 1 1 Not ring finger point 3 11 12 1 1 0 0 Little ring point 3 12 13 1 1 0 1 Not up yours 3 13 14 1 1 1 0 Not index finger point 3 14 15 1 1 1 1 Flat hand 3 15 Table 3 Gesture definition scheme as implemented for the 5DT Data Glove Driver value When the 5DT Data Glove 16 is used the driver sensor indices will return different values The maximum of the two values will be used to test for a flexed closed gesture and the minimum value of the two will be used to test for an unflexed open gesture When the 5DT Data Glove 5 is used both these driver sensor indices will return the same The following gestures are currently defined right hand shown 2 Up Yours Middle finger 0 Fist 1 Index finger point poini 3 Two finger point 7 Three finger point or not 4 Ring finger point 5 Ring index finger point 6 Ring middle finger point little finger point 9 Howzit index and little 10 Little middle finger 8 Little finger point finger point point 11 Not ring finger point 12 Little ring finger point 13 Not up yours 14 Not index finger point 15 Flat hand Figure 3 Gesture Illustrations 18 6 Auto calibration The driver can provide sensor outputs in an automatic linearly c
3. if successful zero if an error occurred Parameters pFG Pointer to a glove device This is the value returned by fdOpen Remarks It is important to call this function when you are finished using the glove int fdGetGloveHand fdGlove pFG Obtains the handedness left or right handed of the glove Return value Returns either FD_HAND_LEFT or FD_HAND_RIGHT as defined by the enumerated type EfdGloveHand Parameters pFG Pointer to a glove device This is the value returned by fdOpen Remarks None int fdGetGloveType fdGlove pFG Obtains the type of the currently connected glove Return value Returns one of FD GLOVENONE FD GLOVET7 FD GLOVET7W FD GLOVE16 or FD_GLOVE1 6W as defined by the enumerated type EfdGloveTypes Parameters pFG Pointer to a glove device This is the value returned by fdOpen Remarks FD GLOVET7 and FD GLOVET7W refer to the original 542 tilt angles sensor glove SDT Data Glove 5 The W suffix indicates a wireless model FD GLOVE16 and FD GLOVE16W refer to the 16 sensor glove In order to accommodate both glove types the fdGetNumSensors function currently returns 18 sensors The additional two sensors are defined as the original tilt angles that are not present in the 16 sensor glove See the description of fdGetNumSensors for more details int fdGetNumSensors fdGlove pFG Obtains the number of available sensors values the driver ca
4. include If not then just place the header file in the same directory as your application 2 3 Sample source code Sample source code that makes use of the glove driver is distributed with the driver 3 Supported gloves The glove driver supports all SDT Data Gloves The current version implements 18 possible sensors and includes the roll and pitch sensors of the original SDT Data Glove 5 The driver attempts to map values to all sensor outputs If it is unable to do so the sensor value defaults to a sensible value This value can be adjusted by forcing a specific value To the application programmer the driver therefore appears the same regardless of the type of glove that is connected 3 1 Sensor mappings for the 5DT Data Glove 5 The sensors on the SDT Data Glove 5 are positioned as in Fig 1 Top of hand Right handed glove Tilt sensor Figure 1 Sensor positions for the 5DT Data Glove 5 Sensor Driver Sensor Index Description A 0 1 Thumb flexure B 3 4 Index finger flexure C 6 7 Middle finger flexure D 9 10 Ring finger flexure E 12 13 Little finger flexure F 16 Pitch angle of tilt sensor G 17 Roll angle of tilt sensor Table 1 Sensor mappings for 5DT Data Glove 5 Both these driver sensor indices will return the same value when the 5DT Data Glove 5 is used 3 2 Sensor mappings for the 5DT Data Glove 16 The sensors on the SDT Data Glove 16 are positioned as in Fig 2 Sensor o MIRN
5. void fdGetThreshold fdGlove pFG int nSensor float pUpper float pLower Obtains the current gesture recognition threshold settings of the driver for a specific sensor Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen nSensor Index of the sensor that is being queried The value must lie in the range given by the enumerated type EfdSensors or alternatively from zero to the value returned by fdGetNumSensors minus one pUpper and pLower Pointers to floating point numbers that will contain the maximum and minimum threshold values Refer to section 6 for details Remarks None void fdSetThresholdAll fdGlove pFG float pUpper float pLower Sets the current gesture recognition threshold settings of the driver Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen pUpper and pLower 14 Arrays of floating point numbers that contains the maximum and minimum threshold values The size of each array must always match the value returned by fdGetNumSensors Refer to section 6 for details Remarks None void fdSetThreshold fdGlove pFG int nSensor float fUpper float fLower Sets the current gesture recognition threshold settings of the driver for a specific sensor Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen nsensor Index of the sens
6. The 5DT Data Glove Driver Reference Manual SDT Version 1 00 January 2000 AUTO CALIBRATION Table of Contents INTRODUCTION EE EE OE edu ap adee 1 USING THE GLOVE DRIVER esse se esse gese Ges ees Reede es ee Deed Re NG Ed ob ne EO edge Re ee dee gevee dee de se 1 2 1 WINDOWS 9508 NT keen add 1 2 EN sr 1 2 2 2 SETTING UP ACCESS TO THE SERIAL PORT oseovorenvesenvesvnnvennevensennnnssnnenensennnsennsee 2 2 2 3 THE HEADER FILE OE OE EA EE EE 2 2 3 SAMPLE SOURCE CODE sesse esse seed ss de see ges de se N Ge dese ees eed ede es vee de ee Oe deed ses ede ede de gereed 2 SUPPORTED GLOVES asse ssssesd dasse ss ke ds dekades de ke de ee eed dek beide das tee sede ordes age es dak bed daad sd ie 3 3 1 SENSOR MAPPINGS FOR THE 5DT DATA GLOVE 5 ssseessee esse esse esse ees see esse es sees see 3 3 2 SENSOR MAPPINGS FOR THE 5DT DATA GLOVE 16 sees see sesse esse esse sesse es see esse ee 4 FUNCTION REFERENCE EE EE EE EE EE EE ENE 5 GESTURE DEEINITIONS seeks eg se eN Ge 16 1 Introduction The 5DT Data Glove Driver provides access to the 5DT range of data gloves at an intermediate level The Windows 95 98 NT version is provided in the form of a C C header h file a Microsoft Visual C library lib file and a dynamic link library dID file The Linux version is provided in form of a C C header h file and a dynamic library so file The driver functionality includes Multiple instances Easy initialization
7. URBQRN OS Top of hand Right handed glove Figure 2 Sensor mappings for the 5DT Data Glove 16 Driver Sensor Index OMDANNHWNF OS Description Thumb flexure lower joint Thumb flexure second joint Thumb index finger abduction Index finger flexure at knuckle Index finger flexure second joint Index middle finger abduction Middle finger flexure at knuckle Middle finger flexure second joint Middle ring finger abduction Ring finger flexure at knuckle Ring finger flexure second joint Ring little finger abduction Little finger flexure at knuckle Little finger flexure second joint Thumb translation not yet implemented Wrist flexure not yet implemented Table 2 Sensor mappings for 5DT Data Glove 16 4 Function reference The following functions are provided by the driver fdGlove fdOpen char pPort Initializes the glove device on the specified port Return value Returns a pointer to the glove device fdGlove NULL is returned if an error occurred Parameter pPort Pointer to a zero terminated ASCII string containing the name of the communication port Valid values on Windows range from COM to COM8 Unix Linux port names will differ Remarks Do not attempt to alter the contents of the returned pointer directly use the functions provided instead int fdClose fdGlove pFG Frees the glove device and communications port Return value Returns nonzero
8. alibrated fashion During every update the raw value read from the sensor is compared to the current minimum and maximum raw values raWmin and raWmax as set by the functions fdSetCalibrationAll fdSetCalibration or fdResetCalibration If the current minimum and maximum values are exceeded they are overwritten The upper and lower calibration values are therefore continuously pushed outwards The normalized output is given by the first order equation FAW a1 TAW mi out TG TAW max TAW min which is in 0 Max The value of Max is set by the functions fdSetSensorMaxAll and fdSetSensorMax Doing a few flexing movements with the hand quickly sets the operating values for rawmin and rawmax and calibrates the glove The auto calibration process can be ignored by simply regarding only the raw sensor outputs It would be up to the application developer to provide a suitable calibration process Note that calibration is mandatory especially with the 16 sensor glove which contains no hardware calibration possibilities miniature preset potentiometers 19
9. and shutdown Basic raw sensor values Scaled auto calibrated sensor values Calibration functions Basic gesture recognition Cross Platform Application Programming Interface 2 Using the glove driver The 5DT Data Glove Driver is easy to implement Use the following guidelines 2 1 Windows 95 98 NT i Make sure that the header file fglove h the library file fglove lib and the dynamic link library file fglove d11 reside in the current application directory or somewhere that they can be found The file fglove dl1l may be copied into your Windows system directory ii Include the header file fglove h in the application where necessary iii Add the library file glove 1ib to the link process There is a also a debug version of the driver fgloved lib fgloved dll which outputs debug messages to the debugger 2 2 Linux The driver requires the Linux Posix threads library libpthread so which is usually installed with Linux The driver is linked to libc6 2 2 1 Installing the library The driver is a dynamic library file 1ibfglove so which must be installed somewhere where applications can find it If you have root access to the system the easiest method is to copy the file into the usr 1ib directory e g 1 cp libfglove so usr lib If you do not have root access to the system you should place the library somewhere in your home directory and then set the LD LIBRARY PATH environment variable to include the f
10. closed and gesture number 15 as all the fingers open The index finger indicates the least significant bit For example the index finger point gesture will therefore be number 1 and the little finger point gesture number will be 8 An invalid unrecognizable gesture is defined as the value 1 A scaled sensor value of higher than the upper threshold setting will indicate a closed finger while a scaled sensor value of lower than the lower threshold setting will indicate an open finger A value in between is invalid and will result in an invalid gesture In the case of multiple finger joint angle measurements such as the 16 sensor glove the maximum of the individual joint sensor values is taken to obtain a closed gesture and the minimum to obtain an open gesture Closed gestures take precedence in other words bending only one joint of a finger will count as a closed gesture The built in gesture recognition capabilities of the glove driver is limited in scope and user independence High level gesture recognition algorithms that rely on training sequences are suggested for advanced applications 16 Finger Litte Ring Middle Index _ SDT Data Glove 5 E D c B sensor 5DT Data Glove 16 12 13 9 10 6 7 3 4 sensor Driver sensor index 12 1 3 9 10 6 7 3 4 ur 2 0 0 0 0 0 Fist 3 0 1 0 0 0 1 Index finger point 3 1 2 0 0 1 0 Up yours 3 2 3 0 0 1 1 Two finger point 3 3 4 0 1
11. e returned by fdGetNumSensors Refer to section 6 for details Remarks For unmapped sensors it would be sensible to set the upper and lower calibration settings above and below the raw value forced with fdSet SensorRaw and fdSetSensorRawAll void fdSetCalibration fdGlove pFG int nSensor unsigned short nUpper unsigned short nLower Resets the current auto calibration settings of the driver for a specific sensor to user defined values Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen nSensor Index of the sensor that is being set The value must lie in the range given by the enumerated type EfdSensors or alternatively from zero to the value returned by fdGetNumSensors minus one nUpper and nLower 16 bit unsigned integers containing the maximum and minimum raw sensor values Refer to section 6 for details Remarks For unmapped sensors it would be sensible to set the upper and lower calibration settings above and below the raw value forced with fdSet SensorRaw and fdSetSensorRawAll void fdResetCalibration fdGlove pFG Resets the internal auto calibration settings of the driver to appropriate default values 11 Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen Remarks This function is similar to the fdSetCalibrationAll function with each of the upper and lower calibration array valu
12. ected glove Return value Returns a floating point sensor value Parameters pFG Pointer to a glove device This is the value returned by fdOpen nSensor Index of the sensor that is being set The value must lie in the range given by the enumerated type EfdSensors or alternatively from zero to the value returned by fdGetNumSensors minus one Remarks The sensor range is a value from zero to the value defined by the fdSet SensorMax and fdSetSensorMaxAll functions The glove driver defaults to a range of 0 1 The automatic calibration process is described in section 6 The enumerated type EfdSensors defines the finger mapping for each sensor int fdGetNumGestures fdGlove pFG Obtains the number of available gestures that can be recognized by the glove driver Return value Returns the number of available gestures Currently 16 different gestures are supported Refer to section 5 for details Parameters pFG Pointer to a glove device This is the value returned by fdOpen Remarks None int fdGetGesture fdGlove pFG Obtains the current gesture being performed Return value Returns the current gesture being performed Refer to section 5 for details Parameters pFG Pointer to a glove device This is the value returned by fdOpen Remarks None void fdGetCalibrationAll fdGlove pFG unsigned short pUpper unsigned short pLower Obtains the current auto calibration settings of the driver
13. es set to 0 and 4095 respectively This function or any of the other calibration functions should be called whenever the application starts up or the glove changes users during run time For unmapped sensors the upper and lower calibration values are set to 4095 and 0 respectively which is the inverse of the auto calibration settings void fdGetSensorMaxAll fdGlove pFG float pMax Obtains the maximum scaled value for each sensor Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen pMax Array of floating point values that will contain the maximum scaled sensor values The size of the array must always match the value returned by fdGet NumSensors Remarks The glove driver defaults to a maximum scaled value of 1 for each sensor float fdGetSensorMax fdGlove pFG int nSensor Obtains the maximum scaled value for a specific sensor Return value Returns the maximum scaled values of the sensor Parameters pFG Pointer to a glove device This is the value returned by fdOpen nSensor Index of the sensor that is being queried The value must lie in the range given by the enumerated type EfdSensors or alternatively from zero to the value returned by fdGetNumSensors minus one Remarks 12 The glove driver defaults to a maximum scaled value of 1 for each sensor void fdSetSensorMaxAll fdGlove pFG float pMax Sets the maximum scaled value for each sens
14. n make available Return value Returns the number of sensors Currently it is fixed at 18 but future driver releases may differ Parameters pFG Pointer to a glove device This is the value returned by fdOpen Remarks Although the 5 sensor glove can measure only average flexure the driver will attempt to fill in missing values The number of sensors returned can therefore be of a higher dimension The enumerated type EfdSensors defines the finger mapping for each sensor void fdGetSensorRawAll fdGlove pFG unsigned short pData Obtains the most recent raw sensor values from the currently connected glove Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen pData Pointer to an array of 16 bit integers that will contain the raw sensor values The size of the array must always match the value returned by fdGetNumSensors Remarks Currently the raw sensor samples are all 12 bit unsigned values The range is therefore from 0 to 4095 Note that this is not the dynamic range of the sensors There can be severe offset values associated with each sensor The enumerated type EfdSensors defines the finger mapping for each sensor unsigned short fdGetSensorRaw fdGlove pFG int nSensor Obtains the most recent raw sensor value for a specific sensor from the currently connected glove Return value Returns a 16 bit integer See fdGet SensorRawA11 for details Parame
15. or Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen pMax Array of floating point values that contains the maximum scaled sensor values The size of the array must always match the value returned by fdGetNumSensors Remarks The glove driver defaults to a maximum scaled value of 1 for each sensor void fdSetSensorMax fdGlove pFG int nSensor float fMax Sets the maximum scaled value for a specific sensor Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen nsensor Index of the sensor that is being set The value must lie in the range given by the enumerated type EfdSensors or alternatively from zero to the value returned by fdGetNumSensors minus one fMax A floating point value that contains the maximum scaled sensor value Remarks The glove driver defaults to a maximum scaled value of 1 for each sensor void fdGetThresholdAll fdGlove pFG float pUpper float pLower Obtains the current gesture recognition threshold settings of the driver Return value None 13 Parameters pFG Pointer to a glove device This is the value returned by fdOpen pUpper and pLower Arrays of floating point numbers that will contain the maximum and minimum threshold values The size of each array must always match the value returned by fdGetNumSensors Refer to section 6 for details Remarks None
16. or that is being set The value must lie in the range given by the enumerated type EfdSensors or alternatively from zero to the value returned by fdGetNumSensors minus one fUpper and fLower Floating point numbers that contain the maximum and minimum threshold values Refer to section 6 for details Remarks None void fdGetGloveInfo fdGlove pFG unsigned char pData Obtains the information data block of the currently connected glove Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen pData Array of 32 bytes that will contain the information data Remarks The information data is specified in the glove user s manual The size of the information block is always 32 bytes 15 void fdGetDriverInfo fdGlove pFG unsigned char pData Obtains the information data block of the driver Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen pData Array of 32 bytes that will contain the information data Remarks The information data is a zero terminated string that contains driver information The size of the information block is always 32 bytes 5 Gesture definitions The currently defined set of gestures is comprised of binary open close configurations of the fingers excluding the thumb There are 2 16 such possible combinations Gesture number 0 is defined as all the fingers excluding the thumb being
17. r alternatively from zero to the value returned by fdGetNumSensors minus one nRaw 16 bit raw value of the sensor If the sensor is unmapped the scaling calculations will proceed as normal Remarks The enumerated type EfdSensors defines the finger mapping for each sensor This function is only useful for sensors that cannot be mapped by a specific hardware device Forcing a sensor value will result in a raw and scaled output other than the default zero Values that can be mapped will be overwritten rendering the forced value void void fdGetSensorScaledAll fdGlove pFG float pData Obtains the most recent scaled auto calibrated sensor values from the currently connected glove Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen pData Pointer to an array of floating point numbers that will contain the scaled sensor values The size of the array must always match the value returned by fdGetNumSensors Remarks The sensor range is a value from zero to the value defined by the fdSet SensorMax and fdSetSensorMaxAll functions The glove driver defaults to a range of 0 1 The automatic calibration process is described in section 6 The enumerated type EfdSensors defines the finger mapping for each sensor float fdGetSensorScaled fdGlove pFG int nSensor Obtains the most recent scaled auto calibrated value for a specific sensor from the currently conn
18. ters pFG Pointer to a glove device This is the value returned by fdOpen nSensor Index of the sensor that is being set The value must lie in the range given by the enumerated type EfdSensors or altematively from zero to the value returned by fdGetNumSensors minus one Remarks The enumerated type EfdSensors defines the finger mapping for each sensor void fdSetSensorRawAll fdGlove pFG unsigned short pData Forces the raw value for all the sensors Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen pData Pointer to an array of 16 bit integers that will contain the raw sensor values The size of the array must always match the value returned by fdGetNumSensors Remarks Currently the raw sensor samples are all 12 bit unsigned values The range is therefore from 0 to 4095 The enumerated type EfdSensors defines the finger mapping for each sensor Forcing a sensor value will result in a raw and scaled output other than the default zero Values that can be mapped will be overwritten rendering the forced value void 7 void fdSetSensorRaw fdGlove pFG int nSensor unsigned short nRaw Forces the raw value for a specific sensor Return value None Parameters pFG Pointer to a glove device This is the value returned by fdOpen nsensor Index of the sensor that is being set The value must lie in the range given by the enumerated type EfdSensors o
19. ull path of the directory in which you have placed the library This will indicate to the dynamic library loader where to find the file For example mkdir home yourhomedir libs cp libfglove so home yourhomedir libs export LD LIBRARY PATH home yourhomedir libs In the above example replace yourhomedir with your own home directory name 2 2 2 Setting up access to the serial port The 5DT Data Glove accesses the serial port using the standard Unix Linux device files in the dev directory Applications that use the glove should typically give the user the option of specifying which device to check such as dev ttyS1 It is recommended that you create a symbolic link dev fglove to your device file e g cd dev In s ttySl fglove This may make the setup of applications easier should you need to change the port that the glove is connected to It is also required that the user of the glove has read write access to the serial port device file By default normally only the root user has these rights If non root users on the system will be using the glove the root user must grant access rights to the device file For example the following command will give everyone on the system full access to the serial port dev ttyS1 chmod 777 dev ttysSl 2 2 3 The header file The header file fglove h should be copied somewhere where your compiler can find it If you have root access the easiest is to copy it to usr

Download Pdf Manuals

image

Related Search

Related Contents

mot droid3 ug us en - Page Plus Cellular  Samsung YP-F2RZW User Manual  ホンダソフト取扱説明書 - 株式会社日本ベンチャー  Capítulo 7 - iscte-iul  Glacier Bay KS-P4 Installation Guide  注意!圧力鍋の蓋が飛んでやけど[PDF形式]  パンフレット (3897KB)  CDX-525RF  1 Premere  English  

Copyright © All rights reserved.
Failed to retrieve file