From 2afbb0313dafe3f52a38ee2061cb1de8043d16e6 Mon Sep 17 00:00:00 2001 From: ultramn Date: Sat, 4 Feb 2017 20:03:12 -0800 Subject: Moved plot_lighthouse to the tools folder --- dave/plot_lighthouse/fileutil.c | 124 ---------------------------------------- 1 file changed, 124 deletions(-) delete mode 100644 dave/plot_lighthouse/fileutil.c (limited to 'dave/plot_lighthouse/fileutil.c') diff --git a/dave/plot_lighthouse/fileutil.c b/dave/plot_lighthouse/fileutil.c deleted file mode 100644 index f892798..0000000 --- a/dave/plot_lighthouse/fileutil.c +++ /dev/null @@ -1,124 +0,0 @@ -#include "fileutil.h" -#include -#include - -#define PI 3.14159265358979323846264 - - -og_mutex_t read_mutex; -og_thread_t read_thread; -double read_hmdAngles[NUM_SWEEP][NUM_HMD]; -int read_hmdAngleViewed[NUM_SWEEP][NUM_HMD]; -int read_frameno=0; - -static FILE *fopen_orDie(const char *path, const char *flag) -{ - FILE *f = fopen(path, flag); - if (f == NULL) { - printf("ERROR could not oepn %s for %s\n", path, flag); - exit(1); - } - return f; -} - -static void SeekToken(FILE *f, const char *keyword) -{ - char token[4096]; - do { - fscanf(f, "%s", token); - } while( strcmp(token,keyword)!=0 && !feof(f) ); -} - -void LoadLighthousePos( - const char *path, - float *x, float *y, float *z, - float *qi, float *qj, float *qk, float *qreal) -{ - FILE *f = fopen_orDie(path,"r"); - SeekToken(f, "POS:"); - fscanf(f, "%f %f %f\n", x, y, z); - SeekToken(f, "QUAT:"); - fscanf(f, "%f %f %f %f\n", qreal, qi, qj, qk); - fclose (f); -} - -void LoadHmdProcessedDataAngles( - const char *path, - double angles[NUM_SWEEP][NUM_HMD]) -{ - int i,j; - char type[256]; - char sweep[256]; - int id; - int nSweep; - double ang; - double d1,d2,d3; // revisit these numbers later - - // Initialize all of the angles to -9999 - for (i=0; iNUM_HMD) { continue; } - - OGLockMutex (read_mutex); - read_hmdAngles[sweepId][id] = angle; - OGUnlockMutex(read_mutex); - read_hmdAngleViewed[sweepId][id] = read_frameno; - } -} - - -- cgit v1.2.3