#include <CRobot.h>
#include <CTimer.h>
#include <CRecognition.h>
+#include <signal.h>
int i = 0;
int numSaved = 0;
Uint8 lastKeys[10000];
int keyNumber = 1000;
Uint8 *keys = NULL;
-bool picture = true;
+
void processKeys()
{
if (keys[SDLK_RETURN])image->saveBmp();
memcpy(lastKeys,keys,keyNumber);
}
+static void sig_handler(int sig)
+{
+ stop = true;
+}
void controlExposition(CRawImage *img, CCamera *camera) {
fprintf(stderr,"usage: %s cameraDevice \ne.g. %s /dev/video0\n",argv[0],argv[0]);
return 0;
}
- while(picture){
+ // Signal handler registration
+ signal(SIGINT, sig_handler);
+ signal(SIGTERM, sig_handler);
+
const char* cameraDevice = argv[1];
//const char* robotDevice = argv[2];
if (i > 100) {
controlExposition(image,camera);
}
-
+
}
- }
+
delete recognition;
//delete robot;
delete image;