#include <stdint.h>
Go to the source code of this file.
Classes | |
struct | sAnalogData |
All the analog data for one frame's worth of time. More... | |
struct | sBodyData |
A structure containing ALL the data to drive one markerset. More... | |
struct | sBodyDef |
The description of a single tracking object that will have streaming data. More... | |
struct | sBodyDefs |
The description of all the data that will stream from Cortex. More... | |
struct | sFrameOfData |
ALL the data for one frame streamed from Cortex. More... | |
struct | sHierarchy |
The rudimentary description of a skeleton's bones and hierarchy. More... | |
struct | sHostInfo |
The description of the connection to Cortex. More... | |
struct | sRecordingStatus |
The recording status tells us the frame numbers and capture filename. More... | |
Defines | |
#define | MAX_N_BODIES 100 |
#define | XEMPTY 9999999.0f |
#define | XYX_ORDER 7 |
#define | XYZ_ORDER 2 |
#define | XZX_ORDER 8 |
#define | XZY_ORDER 6 |
#define | YXY_ORDER 10 |
#define | YXZ_ORDER 3 |
#define | YZX_ORDER 4 |
#define | YZY_ORDER 9 |
#define | ZXY_ORDER 5 |
#define | ZXZ_ORDER 11 |
#define | ZYX_ORDER 1 |
#define | ZYZ_ORDER 12 |
Typedefs | |
typedef enum maReturnCode | maReturnCode |
typedef enum maVerbosityLevel | maVerbosityLevel |
typedef struct sAnalogData | sAnalogData |
All the analog data for one frame's worth of time. | |
typedef struct sBodyData | sBodyData |
A structure containing ALL the data to drive one markerset. | |
typedef struct sBodyDef | sBodyDef |
The description of a single tracking object that will have streaming data. | |
typedef struct sBodyDefs | sBodyDefs |
The description of all the data that will stream from Cortex. | |
typedef struct sFrameOfData | sFrameOfData |
ALL the data for one frame streamed from Cortex. | |
typedef struct sHierarchy | sHierarchy |
The rudimentary description of a skeleton's bones and hierarchy. | |
typedef struct sHostInfo | sHostInfo |
The description of the connection to Cortex. | |
typedef struct sRecordingStatus | sRecordingStatus |
The recording status tells us the frame numbers and capture filename. | |
typedef double | tDofData |
Usually an angle value in degrees. | |
typedef float | tForceData [7] |
X,Y,Z, fX,fY,fZ, mZ. | |
typedef float | tMarkerData [3] |
X,Y,Z. | |
typedef double | tSegmentData [7] |
X,Y,Z, aX,aY,aZ, Length. | |
Enumerations | |
enum | maReturnCode { RC_Okay = 0, RC_GeneralError, RC_ApiError, RC_NetworkError, RC_TimeOut, RC_MemoryError, RC_Unrecognized } |
enum | maVerbosityLevel { VL_None = 0, VL_Error, VL_Warning, VL_Info, VL_Debug } |
Functions | |
void | Cortex_ConstructRotationMatrix (double angles[3], int iRotationOrder, double matrix[3][3]) |
int | Cortex_CopyFrame (const sFrameOfData *pSrc, sFrameOfData *pDst) |
int | Cortex_Exit () |
void | Cortex_ExtractEulerAngles (double matrix[3][3], int iRotationOrder, double angles[3]) |
int | Cortex_FreeBodyDefs (sBodyDefs *pBodyDefs) |
int | Cortex_FreeFrame (sFrameOfData *pFrame) |
sBodyDefs * | Cortex_GetBodyDefs (double timeout) |
sFrameOfData * | Cortex_GetCurrentFrame (double timeout) |
int | Cortex_GetHostInfo (sHostInfo *pHostInfo) |
int | Cortex_GetSdkVersion (unsigned char Version[4]) |
int | Cortex_Initialize (const char *szCortexNicCardAddress) |
int | Cortex_Request (const char *szCommand, void **ppResponse, int *pnBytes, double timeout) |
int | Cortex_SendHtr (sHierarchy *pHierarchy, tSegmentData *pFrame) |
int | Cortex_SetDataHandlerFunc (void(*MyFunction)(sFrameOfData *pFrameOfData, void *params), void *params) |
int | Cortex_SetErrorMsgHandlerFunc (void(*MyFunction)(int iLogLevel, const char *szLogMessage, void *params), void *params) |
int | Cortex_SetMetered (bool bActive, float fFixedLatency) |
int | Cortex_SetMulticastPort (unsigned short port) |
int | Cortex_SetRequestPort (unsigned short port) |
configures Cortex ports | |
int | Cortex_SetVerbosityLevel (int iLevel) |
#define MAX_N_BODIES 100 |
typedef enum maReturnCode maReturnCode |
Return codes
typedef enum maVerbosityLevel maVerbosityLevel |
Verbosity setting for internal messages
typedef struct sAnalogData sAnalogData |
All the analog data for one frame's worth of time.
This includes the raw analog samples, processed forces, and also angle encoder values (if available).
The description of a single tracking object that will have streaming data.
This description includes the object's name, the marker names, the skeleton hierarchy, and the DOF names.
The description of all the data that will stream from Cortex.
This description includes all the body descriptions, the analog channels, and the number of forceplates.
typedef struct sFrameOfData sFrameOfData |
ALL the data for one frame streamed from Cortex.
This include the two items that describe the frame. The first is the frame number. The second is the time delay measuring the delay between the real world action and the host sending this frame. The actual data for the frame includes the data for each body, the unidentified markers, and data that is associated with the analog captures.
typedef struct sHierarchy sHierarchy |
The rudimentary description of a skeleton's bones and hierarchy.
This description is defined by szSegmentNames[iSegment], and iParent[iSegment]
The description of the connection to Cortex.
This contains information about the host machine, the host program, and the connection status.
typedef struct sRecordingStatus sRecordingStatus |
The recording status tells us the frame numbers and capture filename.
typedef double tDofData |
typedef float tForceData[7] |
typedef float tMarkerData[3] |
typedef double tSegmentData[7] |
enum maReturnCode |
enum maVerbosityLevel |
void Cortex_ConstructRotationMatrix | ( | double | angles[3], |
int | iRotationOrder, | ||
double | matrix[3][3] | ||
) |
This function constructs a rotation matrix from three Euler angles.
This function and its inverse are utility functions for processing the HTR rotations we send in each frame of data. We send Euler angles in ZYX format (some interpretations would call it XYZ). Using these conversion utilities should protect against any misinterpretations.
matrix | - 3x3 rotation matrix. |
iRotationOrder | - one of: |
ZYX_ORDER XYZ_ORDER YXZ_ORDER YZX_ORDER ZXY_ORDER XZY_ORDER
angles | - the angles in degrees. |
int Cortex_CopyFrame | ( | const sFrameOfData * | pSrc, |
sFrameOfData * | pDst | ||
) |
This function copies a frame of data.
The Destination frame should start initialized to all zeros. The CopyFrame and FreeFrame functions will handle the memory allocations necessary to fill out the data.
pSrc | - The frame to copy FROM. |
pDst | - The frame to copy TO |
int Cortex_Exit | ( | ) |
void Cortex_ExtractEulerAngles | ( | double | matrix[3][3], |
int | iRotationOrder, | ||
double | angles[3] | ||
) |
This function decodes a rotation matrix into three Euler angles.
This function and its inverse are utility functions for processing the HTR rotations we send in each frame of data. We send Euler angles in ZYX format (some interpretations would call it XYZ). Using these conversion utilities should protect against any misinterpretations.
matrix | - 3x3 rotation matrix. |
iRotationOrder | - one of: |
ZYX_ORDER XYZ_ORDER YXZ_ORDER YZX_ORDER ZXY_ORDER XZY_ORDER
angles | - the angles in degrees. |
int Cortex_FreeBodyDefs | ( | sBodyDefs * | pBodyDefs | ) |
This function frees the memory allocated by Cortex_GetBodyDefs
The data within the structure is freed and also the structure itself.
pBodyDefs | - The item to free. |
int Cortex_FreeFrame | ( | sFrameOfData * | pFrame | ) |
This function frees memory within the structure.
The sFrameOfData structure includes pointers to various pieces of data. That data is dynamically allocated or reallocated to be consistent with the data that has arrived from Cortex. To properly use the sFrameOfData structure, you should use the utility functions supplied. It is possible to reuse sFrameOfData variables without ever freeing them. The SDK will reallocate the components for you.
pFrame | - The frame of data to free. |
sBodyDefs* Cortex_GetBodyDefs | ( | double | timeout | ) |
This function queries Cortex for its set of tracking objects.
sFrameOfData* Cortex_GetCurrentFrame | ( | double | timeout | ) |
This function polls Cortex for the current frame
The SDK user has the streaming data available via the callback function. In addition, this function is available to get a frame directly.
Note: Cortex considers the current frame to be the latest LiveMode frame completed or, if not in LiveMode, the current frame is the one that is displayed on the screen.
int Cortex_GetHostInfo | ( | sHostInfo * | pHostInfo | ) |
This function gets information about the connection to Cortex
This function returns IP-Address information and Cortex version information. The version info can be used to handle incompatible changes in either our code or your code.
pHostInfo | - Structure containing connection information |
int Cortex_GetSdkVersion | ( | unsigned char | Version[4] | ) |
This function returns a 4-byte version number.
Version | - An array of four bytes: ModuleID, Major, Minor, Bugfix |
int Cortex_Initialize | ( | const char * | szCortexNicCardAddress | ) |
This function defines the connection routes to talk to Cortex.
Machines can have more than one ethernet interface. This function is used to either set the ethernet interface to use, or to let the SDK auto-select the local interface, and/or the Cortex host. This function should only be called once at startup.
szCortexNicCardAddress | - "a.b.c.d" or HostName. "" and NULL mean AutoSelect |
int Cortex_Request | ( | const char * | szCommand, |
void ** | ppResponse, | ||
int * | pnBytes, | ||
double | timeout | ||
) |
This function sends commands to Cortex and returns a response.
This function is an extendable interface between the Client programs and the Host (Cortex) program. The commands are sent as readable text strings. The response is returned unaltered.
szCommand | - The request to send the Cortex |
ppResponse | - The reply |
pnBytes | - The number of bytes in the response |
Example: void *pResponse=NULL; Cortex_Request("GetContextFrameRate", &pResponse, sizeof(void*)); fFrameRate = *(float*)pResponse;
int Cortex_SendHtr | ( | sHierarchy * | pHierarchy, |
tSegmentData * | pFrame | ||
) |
This function pushes a skeleton definition to Cortex.
A skeleton, defined in an animation package can be used to start a skeleton model definition in Cortex. The hierarchy and starting pose can come from the animation package. The rest of the details of the skeleton get filled out in the Cortex interface. The parameters to this function match the parameters defining the HTR data that normally gets sent through the SDK2.
pHierarchy | - The number of segments, their names and parent child relationships. |
pFrame | - One frame of HTR data dimensioned according to the number of segments defined in the pHierarchy parameter. |
int Cortex_SetDataHandlerFunc | ( | void(*)(sFrameOfData *pFrameOfData, void *params) | MyFunction, |
void * | params | ||
) |
The user supplied function will be called whenever a frame of data arrives.
The ethernet servicing is done via a thread created when the connection to Cortex is made. This function is called from that thread. Some tasks are not sharable directly across threads. Window redrawing, for example, should be done via events or messages.
MyFunction | - This user supply callback function handles the streaming data |
Notes: The data parameter points to "hot" data. That frame of data will be overwritten with the next call to the callback function.
int Cortex_SetErrorMsgHandlerFunc | ( | void(*)(int iLogLevel, const char *szLogMessage, void *params) | MyFunction, |
void * | params | ||
) |
The user supplied function handles text messages posted from within the SDK.
Logging messages is done as a utility to help code and/or run using the SDK. Various messages get posted for help with error conditions or events that happen. Each message has a Log-Level assigned to it so the user can.
MyFunction | - This user defined function handles messages from the SDK. |
int Cortex_SetMetered | ( | bool | bActive, |
float | fFixedLatency | ||
) |
int Cortex_SetMulticastPort | ( | unsigned short | port | ) |
int Cortex_SetRequestPort | ( | unsigned short | port | ) |
configures Cortex ports
int Cortex_SetVerbosityLevel | ( | int | iLevel | ) |
This function sets the filter level of the LogMessages.
The default verbosity level is VL_Warning.
iLevel | - one of the maVerbosityLevel enum values. |