]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
1. Get team color from orte.
authorPetr Kubiznak <kubizpet@fel.cvut.cz>
Mon, 26 Apr 2010 19:45:56 +0000 (21:45 +0200)
committerPetr Kubiznak <kubizpet@fel.cvut.cz>
Mon, 26 Apr 2010 19:45:56 +0000 (21:45 +0200)
2. Do not use camera_control.on condition until it works correctly.

src/camera/rozkuk/rozkuk.cxx

index f81798f18ca6abb89f183f12a6bf35d1ecfcc821..e949e33e2750bfbb3e4e2bb76d695ba8bab593bd 100644 (file)
@@ -24,6 +24,7 @@
 
 extern "C" {
 #include <roboorte_robottype.h>
+#include <robot.h>
 }
 /******************************************************************************/
 
@@ -245,7 +246,7 @@ int modeRecognize(CvCapture* capture) {
 #endif                                                                         /*----------- DEBUG SESSION ONLY -----------*/
   while(1) {
     //stop recognition and wait if camera control is off
-    if(!orte.camera_control.on) return MODE_WAIT;
+    //FIXME: use the following line if orte works: if(!orte.camera_control.on) return MODE_WAIT;
     
 #ifdef ROZKUK_DEBUG                            /************ DEBUG SESSION ONLY ************/
                /* keyboard events handeling */
@@ -365,12 +366,13 @@ int modeManager(int defaultMode) {
                cvMoveWindow(WINDOW_PROD, cvQueryFrame(capture)->width, cvQueryFrame(capture)->height+50);
 #endif                                                                         /*----------- DEBUG SESSION ONLY -----------*/
       //load masks and run recognition mode, then free masks (they are in memory only while in recognition mode)
-      if((ret=loadMasks(orte.camera_control.game_color))) return ret;
+      if((ret=loadMasks((orte.camera_control.game_color==BLUE ? clBLUE : clYELLOW)))) return ret;
       mode = modeRecognize(capture);
       freeMasks();
       break;
 
     case MODE_WAIT:
+       printf("waiting...\n");
       sleep(1);
       mode = (orte.camera_control.on ? MODE_RECOGNIZE : MODE_WAIT);
       break;