|
|
|
|
|
Example of C / C++ Code using the Atracsys Tracking Library API
void myLedCallback (etkDevice* pDevice, unsigned uLEDID, double* adVector3)
{
if (adVector3)
printf ("Led: %u, Position (%lf, %lf, %lf)\n", uLEDID,
adVector3 [0], adVector3 [1], adVector3 [2]);
else
printf ("Invalid LED position");
}
void* processingThread (void* arg)
{
while (!siQuitThread)
if (etkProcessNextDataFrames (handle, 50) != 50)
etkSleep (100);
pthread_exit (NULL);
}
void main ()
{
etkHandle handle = etkOpen ();
etkSetLedCallback (handle, myLedCallback);
etkInitialize (handle, NULL);
etkDevice device = getDevice (handle, ETK_MASTER);
pthread_t* pThread = new pthread_t;
(void) pthread_create (pThread, NULL, processingThread, NULL);
etkAcquireContinuously (device, ETK_MARKER1 | ETK_MARKER3, 0);
etkClose (handle);
}
|
|
"Be ready in an hour". easyTrack sample code to acquire LEDs positions
from markers one and three and display their position in the console window.
|
Back to FAQ
|
|