*
******************************************************************************/
-extern "C" {
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
#include <unistd.h>
-#include <orte.h>
-//#include "roboorte.h"
-//#include "rozkorte.h"
-}
-
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include "clr2float.h"
+extern "C" {
+#include <roboorte_robottype.h>
+}
/******************************************************************************/
// modes definitions
#define FRAME_HEIGHT 480
#define FRAME_SIZE (FRAME_WIDTH * FRAME_HEIGHT)
+struct robottype_orte_data orte;
+
/******************************************************************************/
// function declarations
clr2float(frame, &floatMat, threshold, SATURATION, thresFrame); // get float representation (in DEBUG session, thresholded image is stored to thresFrame)
layout = recognize(floatMat);
printf("var: %d, thr: %d\n", layout, threshold);
+ orte.camera_result.side = layout;
+ orte.camera_result.center = layout; // FIXME
+ ORTEPublicationSend(orte.publication_camera_result);
+
#ifdef ROZKUK_DEBUG /************ DEBUG SESSION ONLY ************/
displayProduct(floatMat, layout);
#endif /*----------- DEBUG SESSION ONLY -----------*/
cvNamedWindow(WINDOW_PROD, CV_WINDOW_AUTOSIZE);
cvMoveWindow(WINDOW_PROD, cvQueryFrame(capture)->width, cvQueryFrame(capture)->height+50);
#endif /*----------- DEBUG SESSION ONLY -----------*/
- mode = modeRecognize(capture);
- break;
+ //if (orte.camera_control.on)
+ mode = modeRecognize(capture);
+// else
+// sleep(1);
+// break;
default:
goto end; // jump out of the loop
int main(int argc, char *argv[]) {
int ret;
-/* while (orte_init()) {
- perror("orte_init");
- usleep(500*1000);
- }
-*/
+
+ ret = robottype_roboorte_init(&orte);
+ if (ret < 0) {
+ fprintf(stderr, "robottype_roboorte_init failed\n");
+ return ret;
+ }
+ robottype_publisher_camera_result_create(&orte, NULL, NULL);
+ robottype_subscriber_camera_control_create(&orte, NULL, NULL);
+
+
if((ret=loadMasks())) return ret;
ret = modeManager(START_MODE);
freeMasks();
+
+ ret = robottype_roboorte_destroy(&orte);
+
return ret;
}