]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robodim: Structures with chessboard squares centers extended to whole table squares.
authorMichal Vokac <vokac.m@gmail.com>
Tue, 24 May 2011 00:36:11 +0000 (02:36 +0200)
committerMichal Vokac <vokac.m@gmail.com>
Tue, 24 May 2011 00:36:11 +0000 (02:36 +0200)
src/robodim/robodim.c
src/robodim/robodim.h

index eeee9d0e0be0ddf5d4b937bbac831cdb50ca722f..a519cc64b6f85fb0fe2fe7eeba0cf7e08bbab8d4 100644 (file)
@@ -46,34 +46,40 @@ const struct king_pos king[KING_CNT] = {
        {2800, 290 + 4*280},
 };
 
-const struct square_center_red red_sq[12] = {
-       {0.45 + 0.175 + 0*0.35, 4*0.35 + 0.175},        // row 1
-       {0.45 + 0.175 + 2*0.35, 4*0.35 + 0.175},
-       {0.45 + 0.175 + 4*0.35, 4*0.35 + 0.175},
-       {0.45 + 0.175 + 1*0.35, 3*0.35 + 0.175},        // row 2
-       {0.45 + 0.175 + 3*0.35, 3*0.35 + 0.175},
-       {0.45 + 0.175 + 5*0.35, 3*0.35 + 0.175},
-       {0.45 + 0.175 + 0*0.35, 2*0.35 + 0.175},        // row 3
-       {0.45 + 0.175 + 2*0.35, 2*0.35 + 0.175},
-       {0.45 + 0.175 + 4*0.35, 2*0.35 + 0.175},
-       {0.45 + 0.175 + 1*0.35, 1*0.35 + 0.175},        // row 4
-       {0.45 + 0.175 + 3*0.35, 1*0.35 + 0.175},
-       {0.45 + 0.175 + 5*0.35, 1*0.35 + 0.175},
+const struct square_center_red red_sq[SQ_CNTR] = {
+       {0.45 + 0.175 + 5*0.35, 5*0.35 + 0.175}, // 1
+       {0.45 + 0.175 + 5*0.35, 3*0.35 + 0.175}, // 2
+       {0.45 + 0.175 + 5*0.35, 1*0.35 + 0.175}, // 3
+       {0.45 + 0.175 + 4*0.35, 4*0.35 + 0.175}, // 4
+       {0.45 + 0.175 + 4*0.35, 2*0.35 + 0.175}, // 5
+       {0.45 + 0.175 + 3*0.35, 5*0.35 + 0.175}, // 6
+       {0.45 + 0.175 + 3*0.35, 3*0.35 + 0.175}, // 7
+       {0.45 + 0.175 + 3*0.35, 1*0.35 + 0.175}, // 8
+       {0.45 + 0.175 + 2*0.35, 4*0.35 + 0.175}, // 9
+       {0.45 + 0.175 + 2*0.35, 2*0.35 + 0.175}, // 10
+       {0.45 + 0.175 + 1*0.35, 5*0.35 + 0.175}, // 11
+       {0.45 + 0.175 + 1*0.35, 3*0.35 + 0.175}, // 12
+       {0.45 + 0.175 + 1*0.35, 1*0.35 + 0.175}, // 13
+       {0.45 + 0.175 + 0*0.35, 4*0.35 + 0.175}, // 14
+       {0.45 + 0.175 + 0*0.35, 2*0.35 + 0.175}, // 15
 };
 
-const struct square_center_blue blue_sq[12] = {
-       {0.45 + 0.175 + 1*0.35, 4*0.35 + 0.175},        // row 1
-       {0.45 + 0.175 + 3*0.35, 4*0.35 + 0.175},
-       {0.45 + 0.175 + 5*0.35, 4*0.35 + 0.175},
-       {0.45 + 0.175 + 0*0.35, 3*0.35 + 0.175},        // row 2
-       {0.45 + 0.175 + 2*0.35, 3*0.35 + 0.175},
-       {0.45 + 0.175 + 4*0.35, 3*0.35 + 0.175},
-       {0.45 + 0.175 + 1*0.35, 2*0.35 + 0.175},        // row 3
-       {0.45 + 0.175 + 3*0.35, 2*0.35 + 0.175},
-       {0.45 + 0.175 + 5*0.35, 2*0.35 + 0.175},
-       {0.45 + 0.175 + 0*0.35, 1*0.35 + 0.175},        // row 4
-       {0.45 + 0.175 + 2*0.35, 1*0.35 + 0.175},
-       {0.45 + 0.175 + 4*0.35, 1*0.35 + 0.175},
+const struct square_center_blue blue_sq[SQ_CNTR] = {
+       {0.45 + 0.175 + 0*0.35, 5*0.35 + 0.175}, // 1
+       {0.45 + 0.175 + 0*0.35, 3*0.35 + 0.175}, // 2
+       {0.45 + 0.175 + 0*0.35, 1*0.35 + 0.175}, // 3
+       {0.45 + 0.175 + 1*0.35, 4*0.35 + 0.175}, // 4
+       {0.45 + 0.175 + 1*0.35, 2*0.35 + 0.175}, // 5
+       {0.45 + 0.175 + 2*0.35, 5*0.35 + 0.175}, // 6
+       {0.45 + 0.175 + 2*0.35, 3*0.35 + 0.175}, // 7
+       {0.45 + 0.175 + 2*0.35, 1*0.35 + 0.175}, // 8
+       {0.45 + 0.175 + 3*0.35, 4*0.35 + 0.175}, // 9
+       {0.45 + 0.175 + 3*0.35, 2*0.35 + 0.175}, // 10
+       {0.45 + 0.175 + 4*0.35, 5*0.35 + 0.175}, // 11
+       {0.45 + 0.175 + 4*0.35, 3*0.35 + 0.175}, // 12
+       {0.45 + 0.175 + 4*0.35, 1*0.35 + 0.175}, // 13
+       {0.45 + 0.175 + 5*0.35, 4*0.35 + 0.175}, // 14
+       {0.45 + 0.175 + 5*0.35, 2*0.35 + 0.175}, // 15
 };
 // const struct beacon_pos beacon_green[BEACON_CNT] = {
 //     { 3.062, -0.05},  /* EB2009: one side is 10mm only plexiglass */
index 0145400670ec429f86ea2bbdf6ac04a780d12316..d85f3d18e37437a7e2f4fb001986affd294d8491 100644 (file)
 /* queen */
 #define QUEEN_CNT              2
 
+#define SQ_CNTR 15
+
+
 struct beacon_pos {
        float x, y;
 };
@@ -198,8 +201,8 @@ extern const struct pawn_pos pawn[PAWN_CNT];
 extern const struct king_pos king[KING_CNT];
 extern const struct queen_pos queen[QUEEN_CNT];
 
-extern const struct square_center_red red_sq[12];
-extern const struct square_center_blue blue_sq[12];
+extern const struct square_center_red red_sq[SQ_CNTR];
+extern const struct square_center_blue blue_sq[SQ_CNTR];
 
 /*
  * Position of Shapr sensors on the robot with respect to the robot center