#include <CRecognition.h>
+#include <math.h>
#define min(a,b) ((a) < (b) ? (a) : (b))
#define max(a,b) ((a) > (b) ? (a) : (b))
bool white = false;
+
//Vymazani promennych a jejich nastaveni na pocatecni hodnoty
CRecognition::CRecognition()
{
result.x = segmentArray[index].x;
result.y = segmentArray[index].y;
result.info = true;
- //fprintf(stdout,"xy = %i %i\n", result.x, result.y);
+ result.uhel = ((atan2(result.x - 320 , result.y - 240)-M_PI/2)*180)/ M_PI;
+ //fprintf(stdout,"xyu = %i %i %lf \n", result.x, result.y, result.uhel);
}
//vykreslime vysledek
orte.camera_result.y = pos.y;
orte.camera_result.target_valid = pos.info; // OK / NOTĀ OK
orte.camera_result.data_valid = data;
+ orte.camera_result.angle_deg = pos.uhel;
ORTEPublicationSend(orte.publication_camera_result);
- fprintf(stderr, "ORTE: x: %d y: %d, info: %d \n", pos.x, pos.y, pos.info);
+ fprintf(stderr, "ORTE: x: %d y: %d, info: %d uhel: %lf data_valid: %d \n", pos.x, pos.y, pos.info, pos.uhel, data);
}
/* Fce pro zapnuti a vypnuti rozpoznavani */