This module contains a wrapper around the Data Glove SDK by Fifth Dimension Technologies. The underlying SDK can either be version 1 or version 2. Note that some methods are only implemented if the module was compiled with version 2 of the SDK. All the functions from the SDK are wrapped as methods of the DataGlove class. Most methods require that a connection to a glove device was previously established via the open() method.
Returns True if the Data Glove functionality is available.
If this function returns False, an exception will be raised whenever you try to instantiate a class from this module.
This class encapsulates the data glove handle and contains the functions from the SDK as methods. Before you can use most of the methods, you have to establish a connection to a data glove by calling the open() method.
Returns True if a connection to a data glove was established (i.e. if open() was successfully called).
Establish a connection to the data glove at the specified port. port is a string containing the serial port to use. For example, under Windows you might specify "COM1", "COM2", etc.
Disconnect from the glove. The return value is a boolean indicating if there was an error. Calling close() while there is no connection established is not considered an error.
Return the handedness of the glove. The return value is either FD_HAND_LEFT or FD_HAND_RIGHT. If you want a string representation of the handedness you can use the return value as key for the dictionary HANDEDNESS.
Return the type of the data glove. The return value is one of the following:
Type | Description |
---|---|
FD_GLOVENONE | No data glove |
FD_GLOVE5U | Data Glove 5 Ultra serial |
FD_GLOVE5UW | Data Glove 5 Ultra serial, wireless |
FD_GLOVE5U_USB | Data Glove 5 Ultra USB |
FD_GLOVE7 | Data Glove 5 |
FD_GLOVE7W | Data Glove 5, wireless |
FD_GLOVE16 | Data Glove 16 |
FD_GLOVE16W | Data Glove 16, wireless |
FD_GLOVE14U | Data Glove 14 Ultra serial |
FD_GLOVE14UW | Data Glove 14 Ultra serial, wireless |
FD_GLOVE14U_USB | Data Glove 14 Ultra USB |
If you want the string representation of the glove type you can use the return value as key for the dictionary GLOVETYPE.
Todo: The above are only the return values of the v2 SDK.
Return the number of sensors.
Return the number of available gestures.
Return a list with the raw sensor values of all sensors.
Return the raw sensor value of the specified sensor. sensor is an integer in the range between 0 and getNumSensors()-1.
Return a list of the scaled sensor values of all sensors.
Return the scaled sensor value of the specified sensor. sensor is an integer in the range between 0 and getNumSensors()-1.
Return the current auto-calibration settings for all sensors. The return value is a 2-tuple (lower, upper) where lower is a list with the minimum values and upper a list with maximum values.
Return the auto-calibration for one particular sensor. The return value is a 2-tuple (lower, upper) that contains the minimum and maximum value.
Set the auto-calibration settings. lower is a list with the minimum sensor values and upper is a list with the maximum values.
Set the auto-calibration values for one sensor. lower is the minimum sensor value and upper is the maximum value.
Return a list with the maximum scaled values of the sensors.
Return a maximum scaled sensor value for one particular sensor.
Set the maximum scaled sensor values. max is a list with the values.
Set the maximum scaled sensor value for one sensor.
Reset the auto-calibration values. In version 2 of the SDK you can pass an optional sensor index which will only reset that particular sensor.
Return the current gesture.
Return the current gesture recognition threshold values. The return value is a 2-tuple (lower, upper) that contains the lower and upper threshold values.
Return the gesture recognition threshold values for one sensor. The return value is a 2-tuple (lower, upper) that contains the lower and upper threshold value.
Set the gesture recognition threshold values for all sensors. lower is a list with the lower threshold values and upper is a list with the upper threshold values.
Set the gesture recognition threshold values for one sensor. lower is the lower threshold value and upper is the upper threshold value.
Return a string with glove information.
Return a string with driver information.
Scans the USB for available gloves. The return value is a list with product IDs of the gloves found. The product IDs can be one of DG14U_R, DG14U_L, DG5U_R and DG5U_R. — Availability: V2
Set a callback function that gets called when a new packet was received. callback must be a callable object. — Availability: V2
Return the current packet rate in Hertz. — Availability: V2
Returns a boolean that indicates whether new data is available or not. — Availability: V2
Return the major version of the glove’s firmware. This is only implemented for the Data Glove 14 Ultra. Other gloves will always return 0. — Availability: V2
Return the minor version of the glove’s firmware. This is only implemented for the Data Glove 14 Ultra. Other gloves will always return 0. — Availability: V2
Returns True if auto calibration is activated. — Availability: V2
Enable or disable auto-calibration. If flag is True auto-calibration is enabled. — Availability: V2
Save the current calibration data to disk. — Availability: V2
Load the calibration settings from a file. — Availability: V2
Note
The module uses the SDK by Fifth Dimension Technologies (5DT) which can be found at http://www.5dt.com/. The following is the copyright information of the SDK:
Copyright (C) 2000-2004, 5DT <Fifth Dimension Technologies>