Phidget Spatial
[Specific Phidgets]


Data Structures

struct  _CPhidgetSpatial_SpatialEventData

Typedefs

typedef struct _CPhidgetSpatial * CPhidgetSpatialHandle
typedef struct
_CPhidgetSpatial_SpatialEventData 
CPhidgetSpatial_SpatialEventData
typedef struct
_CPhidgetSpatial_SpatialEventData
CPhidgetSpatial_SpatialEventDataHandle

Functions

int CPhidgetSpatial_create (CPhidgetSpatialHandle *phid)
int CPhidgetSpatial_getAccelerationAxisCount (CPhidgetSpatialHandle phid, int *count)
int CPhidgetSpatial_getGyroAxisCount (CPhidgetSpatialHandle phid, int *count)
int CPhidgetSpatial_getCompassAxisCount (CPhidgetSpatialHandle phid, int *count)
int CPhidgetSpatial_getAcceleration (CPhidgetSpatialHandle phid, int index, double *acceleration)
int CPhidgetSpatial_getAccelerationMax (CPhidgetSpatialHandle phid, int index, double *max)
int CPhidgetSpatial_getAccelerationMin (CPhidgetSpatialHandle phid, int index, double *min)
int CPhidgetSpatial_getAngularRate (CPhidgetSpatialHandle phid, int index, double *angularRate)
int CPhidgetSpatial_getAngularRateMax (CPhidgetSpatialHandle phid, int index, double *max)
int CPhidgetSpatial_getAngularRateMin (CPhidgetSpatialHandle phid, int index, double *min)
int CPhidgetSpatial_getMagneticField (CPhidgetSpatialHandle phid, int index, double *magneticField)
int CPhidgetSpatial_getMagneticFieldMax (CPhidgetSpatialHandle phid, int index, double *max)
int CPhidgetSpatial_getMagneticFieldMin (CPhidgetSpatialHandle phid, int index, double *min)
int CPhidgetSpatial_zeroGyro (CPhidgetSpatialHandle phid)
int CPhidgetSpatial_getDataRate (CPhidgetSpatialHandle phid, int *milliseconds)
int CPhidgetSpatial_setDataRate (CPhidgetSpatialHandle phid, int milliseconds)
int CPhidgetSpatial_getDataRateMax (CPhidgetSpatialHandle phid, int *max)
int CPhidgetSpatial_getDataRateMin (CPhidgetSpatialHandle phid, int *min)
int CPhidgetSpatial_setCompassCorrectionParameters (CPhidgetSpatialHandle phid, 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)
int CPhidgetSpatial_resetCompassCorrectionParameters (CPhidgetSpatialHandle phid)
int CPhidgetSpatial_set_OnSpatialData_Handler (CPhidgetSpatialHandle phid, int(*fptr)(CPhidgetSpatialHandle phid, void *userPtr, CPhidgetSpatial_SpatialEventDataHandle *data, int dataCount), void *userPtr)

Detailed Description

These calls are specific to the Phidget Spatial object. See your device's User Guide for more specific API details, technical information, and revision details. The User Guide, along with other resources, can be found on the product page for your device.

Typedef Documentation

typedef struct _CPhidgetSpatial* CPhidgetSpatialHandle

A Phidget Spatial handle

Timestamped position data returned by the CPhidgetSpatial_set_OnSpatialData_Handler event.


Function Documentation

int CPhidgetSpatial_create ( CPhidgetSpatialHandle phid  ) 

Creates a Phidget Spatial handle.

Parameters:
phid A pointer to an unallocated Phidget Spatial handle.

int CPhidgetSpatial_getAccelerationAxisCount ( CPhidgetSpatialHandle  phid,
int *  count 
)

Gets the number of acceleration axes supplied by this board.

Parameters:
phid An attached phidget spatial handle.
count The number of acceleration axes.

int CPhidgetSpatial_getGyroAxisCount ( CPhidgetSpatialHandle  phid,
int *  count 
)

Gets the number of gyroscope axes supplied by this board.

Parameters:
phid An attached phidget spatial handle.
count The number of gyro axes.

int CPhidgetSpatial_getCompassAxisCount ( CPhidgetSpatialHandle  phid,
int *  count 
)

Gets the number of compass axes supplied by this board.

Parameters:
phid An attached phidget spatial handle.
count The number of compass axes.

int CPhidgetSpatial_getAcceleration ( CPhidgetSpatialHandle  phid,
int  index,
double *  acceleration 
)

Gets the current acceleration of an axis.

Parameters:
phid An attached phidget spatial handle.
index The acceleration index.
acceleration The acceleration in gs.

int CPhidgetSpatial_getAccelerationMax ( CPhidgetSpatialHandle  phid,
int  index,
double *  max 
)

Gets the maximum accleration supported by an axis.

Parameters:
phid An attached phidget spatial handle.
index The acceleration index
max The maximum acceleration

int CPhidgetSpatial_getAccelerationMin ( CPhidgetSpatialHandle  phid,
int  index,
double *  min 
)

Gets the minimum acceleration supported by an axis.

Parameters:
phid An attached phidget spatial handle.
index The acceleration index
min The minimum acceleration

int CPhidgetSpatial_getAngularRate ( CPhidgetSpatialHandle  phid,
int  index,
double *  angularRate 
)

Gets the current angular rate of an axis.

Parameters:
phid An attached phidget spatial handle.
index The angular rate index.
angularRate The angular rate in degrees/second.

int CPhidgetSpatial_getAngularRateMax ( CPhidgetSpatialHandle  phid,
int  index,
double *  max 
)

Gets the maximum angular rate supported by an axis.

Parameters:
phid An attached phidget spatial handle.
index The angular rate index
max The maximum angular rate

int CPhidgetSpatial_getAngularRateMin ( CPhidgetSpatialHandle  phid,
int  index,
double *  min 
)

Gets the minimum angular rate supported by an axis.

Parameters:
phid An attached phidget spatial handle.
index The angular rate index
min The minimum angular rate

int CPhidgetSpatial_getMagneticField ( CPhidgetSpatialHandle  phid,
int  index,
double *  magneticField 
)

Gets the current magnetic field stregth of an axis.

Parameters:
phid An attached phidget spatial handle.
index The magnetic field index.
magneticField The magnetic field strength in Gauss.

int CPhidgetSpatial_getMagneticFieldMax ( CPhidgetSpatialHandle  phid,
int  index,
double *  max 
)

Gets the maximum magnetic field stregth supported by an axis.

Parameters:
phid An attached phidget spatial handle.
index The magnetic field index
max The maximum magnetic field stregth

int CPhidgetSpatial_getMagneticFieldMin ( CPhidgetSpatialHandle  phid,
int  index,
double *  min 
)

Gets the minimum magnetic field stregth supported by an axis.

Parameters:
phid An attached phidget spatial handle.
index The magnetic field index
min The minimum magnetic field stregth

int CPhidgetSpatial_zeroGyro ( CPhidgetSpatialHandle  phid  ) 

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.

Parameters:
phid An attached phidget spatial handle.

int CPhidgetSpatial_getDataRate ( CPhidgetSpatialHandle  phid,
int *  milliseconds 
)

Get the data rate.

Parameters:
phid An attached phidget spatial handle.
milliseconds The data rate in milliseconds.

int CPhidgetSpatial_setDataRate ( CPhidgetSpatialHandle  phid,
int  milliseconds 
)

Sets the data rate. Note that data at rates faster then 8ms will be delivered to events as an array of data.

Parameters:
phid An attached phidget spatial handle.
milliseconds The data rate in milliseconds.

int CPhidgetSpatial_getDataRateMax ( CPhidgetSpatialHandle  phid,
int *  max 
)

Gets the maximum supported data rate.

Parameters:
phid An attached phidget spatial handle.
max Data rate in ms.

int CPhidgetSpatial_getDataRateMin ( CPhidgetSpatialHandle  phid,
int *  min 
)

Gets the minimum supported data rate.

Parameters:
phid An attached phidget spatial handle.
min Data rate in ms.

int CPhidgetSpatial_setCompassCorrectionParameters ( CPhidgetSpatialHandle  phid,
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 
)

Sets the compass correction factors. This can be used to correcting any sensor errors, including hard and soft iron offsets and sensor error factors.

Parameters:
phid An attached phidget spatial handle.
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.

int CPhidgetSpatial_resetCompassCorrectionParameters ( CPhidgetSpatialHandle  phid  ) 

Resets the compass correction factors. Magnetic field data will be presented directly as reported by the sensor.

Parameters:
phid An attached phidget spatial handle.

int CPhidgetSpatial_set_OnSpatialData_Handler ( CPhidgetSpatialHandle  phid,
int(*)(CPhidgetSpatialHandle phid, void *userPtr, CPhidgetSpatial_SpatialEventDataHandle *data, int dataCount)  fptr,
void *  userPtr 
)

Set a Data event handler. This is called at /ref CPhidgetSpatial_getDataRate, up to 8ms, for faster then 8ms data, multiple sets of data are supplied in a single event.

Parameters:
phid An attached phidget spatial handle.
fptr Callback function pointer.
userPtr A pointer for use by the user - this value is passed back into the callback function.


Generated on Wed Jan 5 12:08:42 2022 for Phidget21 by  doxygen 1.5.9