IWRGetTracking returning zeros
Vuzix Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



IWRGetTracking returning zerosExpand / Collapse
Author
Message
Posted 9/19/2009 1:44:50 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/30/2009 5:33:01 PM
Posts: 9, Visits: 30
I'm trying to get access to the tracking data from the headware using the following code (which compiles with no warnings under mingw gcc) :

#define IWEARDRV_EXPLICIT
#include
#include "iweardrv.h"
#include "iwrstdrv.h"


// ***************************** Main windows entry point *******************************
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow) {
printf("started");

HINSTANCE m_hIwear = LoadLibrary(TEXT("IWEARDRV.DLL"));
if (m_hIwear) {
IWROpenTracker = (PIWROPENTRACKER)GetProcAddress(m_hIwear, TEXT("IWROpenTracker"));
IWRCloseTracker = (PIWRCLOSETRACKER)GetProcAddress(m_hIwear, TEXT("IWRCloseTracker"));
IWRZeroSet = (PIWRZEROSET)GetProcAddress(m_hIwear, TEXT("IWRZeroSet"));
IWRGetTracking = (PIWRGETTRACKING)GetProcAddress(m_hIwear, TEXT("IWRGetTracking"));
IWRSetFilterState = (PIWRSETFILTERSTATE)GetProcAddress(m_hIwear, TEXT("IWRSetFilterState"));
}
else {
printf("Error opening tracker");
exit(1);
}

printf("opening tracker");

DWORD open_res=IWROpenTracker();

if (open_res==ERROR_SUCCESS) {
printf("tracker opened ok!");
long yaw=0;
long pitch=0;
long roll=0;
printf("getting tracking...");
//DWORD trk_res=0;
DWORD trk_res=IWRGetTracking(&yaw,&pitch, &roll);
if (trk_res==ERROR_SUCCESS) {
printf("tracker polled ok!");
printf("yaw: %lu pitch: %lu roll: %lu",yaw,pitch,roll);
}
else {
printf("Error polling tracking location");
}
IWRCloseTracker();
}
if (open_res==ERROR_DEV_NOT_EXIST) {
printf("Error opening tracker - not connected to computer!");
}

if (m_hIwear) {
FreeLibrary(m_hIwear);
m_hIwear=NULL;
}

printf("finished!");
return 0;
}



For output all I get are zeros! Can anyone tell me why? The iWearMonitor seems to be working fine. I can even read version numbers correctly - but not the tracking!!!!!

Post #4496
Posted 9/19/2009 2:41:02 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/30/2009 5:33:01 PM
Posts: 9, Visits: 30
Found it - after many, many hours of head scratching.

Putting a Sleep(100) command in there to slow it down - all works!

Sheeeeesh. Not looking forward to this project....
Post #4497
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: TechSupport, Daddo, Tech_Support

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 1:14pm

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0.031. 11 queries. Compression Enabled.