void cleanup() { // Stop the optotrak (Optotrak class should be RAII but for every evenience we stop it...) optotrak.stopCollection(); for (int i=0; i<3; i++) Beep(880,220); boost::this_thread::sleep(boost::posix_time::milliseconds(1000)); }
void handleKeypress(unsigned char key, int x, int y) { switch (key) { //Quit program case 'q': case 27: { optotrak.stopCollection(); Sleep(1000); exit(0); } break; case 'i': infoDrawn=!infoDrawn; break; case ' ': { // Here we record the head shape - coordinates of eyes and markers, but centered in (0,0,0) if ( headCalibrationDone==0 && allVisiblePatch ) { headEyeCoords.init(markers[17].p,markers[18].p, markers[1].p,markers[2].p,markers[3].p,interoculardistance ); headCalibrationDone=1; beepOk(); break; } // Second calibration, you must look a fixed fixation point if ( headCalibrationDone==1 && allVisiblePatch) { headEyeCoords.init( headEyeCoords.getP1().p,headEyeCoords.getP2().p, markers[1].p, markers[2].p,markers[3].p,interoculardistance ); headCalibrationDone=2; beepOk(); break; } if ( headCalibrationDone==2 && allVisiblePatch ) { headEyeCoords.init( headEyeCoords.getP1().p,headEyeCoords.getP2().p, markers[1].p, markers[2].p,markers[3].p,interoculardistance ); beepOk(); break; } } break; // Enter key: press to make the final calibration case 13: { if ( canCalibrate && headCalibrationDone == 2 && allVisiblePatch ) { headEyeCoords.init( headEyeCoords.getP1().p,headEyeCoords.getP2().p, markers[1].p, markers[2].p,markers[3].p,interoculardistance ); headCalibrationDone=3; infoDrawn=false; for (int i=0; i<3; i++) beepOk(); } } break; } }
void cleanup() { optotrak.stopCollection(); }
void cleanup() { // Stop the optotrak optotrak.stopCollection(); }