Public Member Functions | |
final void | addSpatialDataListener (SpatialDataListener l) |
native double | getAcceleration (int index) throws PhidgetException |
native int | getAccelerationAxisCount () throws PhidgetException |
native double | getAccelerationMax (int index) throws PhidgetException |
native double | getAccelerationMin (int index) throws PhidgetException |
native double | getAngularRate (int index) throws PhidgetException |
native double | getAngularRateMax (int index) throws PhidgetException |
native double | getAngularRateMin (int index) throws PhidgetException |
native int | getCompassAxisCount () throws PhidgetException |
native int | getDataRate () throws PhidgetException |
native int | getDataRateMax () throws PhidgetException |
native int | getDataRateMin () throws PhidgetException |
native int | getGyroAxisCount () throws PhidgetException |
native double | getMagneticField (int index) throws PhidgetException |
native double | getMagneticFieldMax (int index) throws PhidgetException |
native double | getMagneticFieldMin (int index) throws PhidgetException |
final void | removeSpatialDataListener (SpatialDataListener l) |
native void | resetCompassCorrectionParameters () throws PhidgetException |
native void | setCompassCorrectionParameters (double magField, double offset0, double offset1, double offset2, double gain0, double gain1, double gain2, double T0, double T1, double T2, double T3, double T4, double T5) throws PhidgetException |
native void | setDataRate (int rate) throws PhidgetException |
SpatialPhidget () throws PhidgetException | |
native void | zeroGyro () throws PhidgetException |
Private Member Functions | |
final void | enableDeviceSpecificEvents (boolean b) |
native void | enableSpatialDataEvents (boolean b) |
void | fireSpatialData (SpatialDataEvent e) |
Static Private Member Functions | |
static native long | create () throws PhidgetException |
Private Attributes | |
long | nativeSpatialDataHandler = 0 |
LinkedList | spatialDataListeners = new LinkedList () |
This class represents a Phidget Spatial. All methods for a PhidgetSpatial are implemented in this class.
The Phidget Spatial may provide up to 3 axes of acceleration data, 3 axes of angular rate data and 3 axes of magnetic field data.
Definition at line 17 of file SpatialPhidget.java.
com.phidgets.SpatialPhidget.SpatialPhidget | ( | ) | throws PhidgetException [inline] |
Definition at line 19 of file SpatialPhidget.java.
final void com.phidgets.SpatialPhidget.addSpatialDataListener | ( | SpatialDataListener | l | ) | [inline] |
Adds a spatial data listener. The spatial data handler is a method that will be called at a rate of DataRate that has been set for the device. This event contains data for all axes of all sensors.
There is no limit on the number of spatial data handlers that can be registered for a particular Phidget.
l | An implemetation of the SpatialDataListener interface |
Definition at line 182 of file SpatialPhidget.java.
static native long com.phidgets.SpatialPhidget.create | ( | ) | throws PhidgetException [static, private] |
final void com.phidgets.SpatialPhidget.enableDeviceSpecificEvents | ( | boolean | b | ) | [inline, private] |
Reimplemented from com.phidgets.Phidget.
Definition at line 170 of file SpatialPhidget.java.
native void com.phidgets.SpatialPhidget.enableSpatialDataEvents | ( | boolean | b | ) | [private] |
void com.phidgets.SpatialPhidget.fireSpatialData | ( | SpatialDataEvent | e | ) | [inline, private] |
Definition at line 196 of file SpatialPhidget.java.
native double com.phidgets.SpatialPhidget.getAcceleration | ( | int | index | ) | throws PhidgetException |
Returns the acceleration of a particular axis.
index | index of the axis |
PhidgetException | If this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached. |
native int com.phidgets.SpatialPhidget.getAccelerationAxisCount | ( | ) | throws PhidgetException |
Returns the number of accelerometer axes.
native double com.phidgets.SpatialPhidget.getAccelerationMax | ( | int | index | ) | throws PhidgetException |
Returns the maximum acceleration value that this axis will report.
native double com.phidgets.SpatialPhidget.getAccelerationMin | ( | int | index | ) | throws PhidgetException |
Returns the minimum acceleration value that this axis will report.
native double com.phidgets.SpatialPhidget.getAngularRate | ( | int | index | ) | throws PhidgetException |
Returns the angularRate of a particular axis.
index | index of the axis |
PhidgetException | If this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached. |
native double com.phidgets.SpatialPhidget.getAngularRateMax | ( | int | index | ) | throws PhidgetException |
Returns the maximum angularRate value that this axis will report.
native double com.phidgets.SpatialPhidget.getAngularRateMin | ( | int | index | ) | throws PhidgetException |
Returns the minimum angularRate value that this axis will report.
native int com.phidgets.SpatialPhidget.getCompassAxisCount | ( | ) | throws PhidgetException |
Returns the number of compass axes.
native int com.phidgets.SpatialPhidget.getDataRate | ( | ) | throws PhidgetException |
Returns the data rate, in milliseconds.
PhidgetException | If this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached. |
native int com.phidgets.SpatialPhidget.getDataRateMax | ( | ) | throws PhidgetException |
Returns the maximum data rate, in milliseconds.
PhidgetException | If this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached. |
native int com.phidgets.SpatialPhidget.getDataRateMin | ( | ) | throws PhidgetException |
Returns the minimum data rate, in milliseconds.
PhidgetException | If this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached. |
native int com.phidgets.SpatialPhidget.getGyroAxisCount | ( | ) | throws PhidgetException |
Returns the number of gyro axes.
native double com.phidgets.SpatialPhidget.getMagneticField | ( | int | index | ) | throws PhidgetException |
Returns the magneticField of a particular axis.
index | index of the axis |
PhidgetException | If this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached. |
native double com.phidgets.SpatialPhidget.getMagneticFieldMax | ( | int | index | ) | throws PhidgetException |
Returns the maximum magneticField value that this axis will report.
native double com.phidgets.SpatialPhidget.getMagneticFieldMin | ( | int | index | ) | throws PhidgetException |
Returns the minimum magneticField value that this axis will report.
final void com.phidgets.SpatialPhidget.removeSpatialDataListener | ( | SpatialDataListener | l | ) | [inline] |
Definition at line 190 of file SpatialPhidget.java.
native void com.phidgets.SpatialPhidget.resetCompassCorrectionParameters | ( | ) | throws PhidgetException |
Resets the compass correction factors. Magnetic field data will be presented directly as reported by the sensor.
PhidgetException | If this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached. |
native void com.phidgets.SpatialPhidget.setCompassCorrectionParameters | ( | double | magField, |
double | offset0, | ||
double | offset1, | ||
double | offset2, | ||
double | gain0, | ||
double | gain1, | ||
double | gain2, | ||
double | T0, | ||
double | T1, | ||
double | T2, | ||
double | T3, | ||
double | T4, | ||
double | T5 | ||
) | throws PhidgetException |
Sets the compass correction factors. This can be used to correcting any sensor errors, including hard and soft iron offsets and sensor error factors.
magField | Local magnetic field strength. |
offset0 | Axis 0 offset correction. |
offset1 | Axis 1 offset correction. |
offset2 | Axis 2 offset correction. |
gain0 | Axis 0 gain correction. |
gain1 | Axis 1 gain correction. |
gain2 | Axis 2 gain correction. |
T0 | Non-orthogonality correction factor 0. |
T1 | Non-orthogonality correction factor 1. |
T2 | Non-orthogonality correction factor 2. |
T3 | Non-orthogonality correction factor 3. |
T4 | Non-orthogonality correction factor 4. |
T5 | Non-orthogonality correction factor 5. |
PhidgetException | If this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached. |
native void com.phidgets.SpatialPhidget.setDataRate | ( | int | rate | ) | throws PhidgetException |
Sets the data rate, in milliseconds.
rate | data rate |
PhidgetException | If this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached. |
native void com.phidgets.SpatialPhidget.zeroGyro | ( | ) | throws PhidgetException |
Zeroes the gyroscope. This takes about two seconds and the gyro zxes will report 0 during the process. This should only be called when the board is not moving.
PhidgetException | If this Phidget is not opened and attached, or if the index is out of range. See open for information on determining if a device is attached. |
long com.phidgets.SpatialPhidget.nativeSpatialDataHandler = 0 [private] |
Definition at line 189 of file SpatialPhidget.java.
LinkedList com.phidgets.SpatialPhidget.spatialDataListeners = new LinkedList () [private] |
Definition at line 188 of file SpatialPhidget.java.