00001 /* 00002 * DataThreads.cc 00003 * 00004 * Created on: Feb 18, 2010 00005 * Author: uscr 00006 */ 00007 00008 #ifndef DATATHREADS_H_ 00009 #define DATATHREADS_H_ 00010 00011 #include <opencv/cv.h> 00012 00013 00014 #define NUM_POINTS 1000 00015 #define OUTLIER_SUM_RANGE 7 00016 //below is in degrees for a jump 00017 #define OUTLIER_REJECT_ERROR 5 00018 00019 #define STARTING_SUM_NUM 1 00020 00021 00022 struct CollectedData { 00023 double imuPitchAngle[NUM_POINTS]; 00024 double imuRollAngle[NUM_POINTS]; 00025 double imuPitchGyroVal[NUM_POINTS]; 00026 double imuPitchAccelVal[NUM_POINTS]; 00027 double imuRollGyroVal[NUM_POINTS]; 00028 double imuRollAccelVal[NUM_POINTS]; 00029 00030 double camPitchAngle[NUM_POINTS]; 00031 double camRollAngle[NUM_POINTS]; 00032 00033 double imuOutlierSumPoints[OUTLIER_SUM_RANGE]; 00034 00035 int oldestPoint; 00036 00037 double imuDeltaT[NUM_POINTS]; //in milliseconds 00038 long imuLastT; //in microseconds 00039 00040 bool guiReading; 00041 00042 IplImage * currentCamImage; 00043 CvPoint curRectangle[4]; 00044 int frameCounter; 00045 }; 00046 00047 00048 //stuffs for artoolkit: 00049 #define RED_THRESH 40 00050 00051 void initializeDataThreads(); 00052 void shutdownDataThreads(); 00053 void * runIMUThread(void * var); 00054 void * runCamThread(void * var); 00055 void * runGuiThread(void * var); 00056 00057 00058 #endif