From 337e4b9e3a92a56694827e37da0680bcad1fde90 Mon Sep 17 00:00:00 2001 From: Michal Vokac Date: Tue, 24 May 2011 02:36:11 +0200 Subject: [PATCH] robodim: Structures with chessboard squares centers extended to whole table squares. --- src/robodim/robodim.c | 58 ++++++++++++++++++++++++------------------- src/robodim/robodim.h | 7 ++++-- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/src/robodim/robodim.c b/src/robodim/robodim.c index eeee9d0e..a519cc64 100644 --- a/src/robodim/robodim.c +++ b/src/robodim/robodim.c @@ -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 */ diff --git a/src/robodim/robodim.h b/src/robodim/robodim.h index 01454006..d85f3d18 100644 --- a/src/robodim/robodim.h +++ b/src/robodim/robodim.h @@ -163,6 +163,9 @@ /* 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 -- 2.39.2