]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robodim/robodim.h
ROBODIM: change robot dimension for competition 2011, play chess!
[eurobot/public.git] / src / robodim / robodim.h
1 /*
2  * robodim_eb2010.h
3  *
4  * Dimensions for the robot, playground and other stuff.
5  * Eurobot 2010
6  *
7  * Copyright: (c) 2008 - 2010 CTU Dragons
8  *            CTU FEE - Department of Control Engineering
9  * License: GNU GPL v.2
10  */
11
12 #ifndef ROBODIM_EB2010_H
13 #define ROBODIM_EB2010_H
14
15 /**
16  * FIXME: update robot's dimensions !!!
17  *        and update the pitcture
18  *
19  * ROBOT DIMENSIONS FOR COMPETITION 2011, Play Chess!
20  *
21  *        ^ +--------------------------+@------\
22  *        | |   |     |                |        \
23  *     ^  | |   -------                |    .....
24  *   RR|  | | HOK     :                |  .       .
25  *     v  | |  __  :                   | .         .
26  *       W| | |__|                     |.           .
27  *        | |  AF  :       AB          | .         .
28  *        | |<---->:<----------------->|  .       . 
29  *        | |   -------                |   .......
30  *        | |   |     |                |         /
31  *        v +--------------------------+@-------/
32  *  <<=            <-->                <--------->
33  *   direction      WR                 JA
34  *   of motion                         <------------>
35  *                                      PW
36  */
37
38 /* FIXME update robot's dimensions!!! */
39 #define ROBOT_WIDTH_MM 310      /* W*/
40 #define ROBOT_WIDTH_M (ROBOT_WIDTH_MM/1000.0)
41 #define ROBOT_ROTATION_RADIUS_MM ((200)/2) /* RR */
42 #define ROBOT_ROTATION_RADIUS_M (ROBOT_ROTATION_RADIUS_MM/1000.0)
43 #define ROBOT_WHEEL_RADIUS_MM 38 /* WR */
44 #define ROBOT_WHEEL_RADIUS_M (ROBOT_WHEEL_RADIUS_MM/1000.0)
45 #define ROBOT_AXIS_TO_BACK_MM 220 /* AB */
46 #define ROBOT_AXIS_TO_BACK_M (ROBOT_AXIS_TO_BACK_MM/1000.0)
47 #define ROBOT_AXIS_TO_FRONT_MM 50 /* AF */
48 #define ROBOT_AXIS_TO_FRONT_M (ROBOT_AXIS_TO_FRONT_MM/1000.0)
49
50 #define HOKUYO_CENTER_OFFSET_MM 0 
51 #define HOKUYO_CENTER_OFFSET_M  (HOKUYO_CENTER_OFFSET_MM/1000.0)
52 #define ODOMETRY_WHEEL_RADIUS_MM 30
53 #define ODOMETRY_WHEEL_RADIUS_M (ODOMETRY_WHEEL_RADIUS_MM/1000.0)
54 #define ODOMETRY_ROTATION_RADIUS_MM (284/2)
55 #define ODOMETRY_ROTATION_RADIUS_M (ODOMETRY_ROTATION_RADIUS_MM/1000.0)
56 #define ROBOT_JAWS_LENGHT_MM 105 /* JA */ 
57 #define ROBOT_JAWS_LENGHT_M (ROBOT_JAWS_LENGHT_MM/1000.0)
58 #define ROBOT_LENGHT_WITH_PANWS_MM 170 /* PW */ 
59 #define ROBOT_LENGHT_WITH_PAWNS_M (ROBOT_LENGHT_WITH_PANWS_MM/1000.0)
60
61 /**
62  * PLAYGROUND DIMENSIONS
63  *
64  *            S2                                                                  R3
65  *            +---------------------------------+---------------------------------+
66  *        ^   |               |                                              [W,H]|
67  *        |   |    SL_T_R     |                                                   |
68  *        |   |<------------->|                                                   |
69  *        |   |               |                                                   |
70  *        |   |                                                                   |
71  *        |   |                                                                   |
72  *        |   |                                                                   |
73  *        |   |                                                                   |
74  *      H | R1|                                                                   |S1
75  *        |   |                                                                   |
76  *        |   |                                                                   |
77  *        |   |                                                                   |
78  *        |   |                                                                   |
79  *        |   |                                                                   |
80  *        |   |                                                                   |
81  *        |   |                                                                   |
82  *        v   |[0,0]                                                              |
83  *            +---------------------------------+---------------------------------+
84  *            S3                                                                  R2
85  *             <----------------------------------------------------------------->
86  *                                              W
87  */
88 #define PLAYGROUND_WIDTH_MM     3000
89 #define PLAYGROUND_WIDTH_M      (PLAYGROUND_WIDTH_MM/1000.0)
90 #define PLAYGROUND_HEIGHT_MM    2100
91 #define PLAYGROUND_HEIGHT_M     (PLAYGROUND_HEIGHT_MM/1000.0)
92
93 #define SLOPE_TO_RIM_MM         740
94 #define SLOPE_TO_RIM_M          (SLOPE_TO_RIM_MM/1000.0)
95 #define SLOPE_LENGTH_MM         519.23
96 #define SLOPE_LENGTH_M          (SLOPE_LENGTH_MM/1000.0)
97
98 #define SQUARE_WIDTH_MM                 350
99 #define SQUARE_HEIGHT_MM                350
100
101 #define BLINE_WIDTH_MM                  50
102 #define BLINE_HEIGHT_MM                 2100
103
104 #define BLOCK_WIDTH_MM                  400
105 #define BLOCK_HEIGHT_MM                 22
106
107 #define STARTAREA_WIDTH_MM              400
108 #define STARTAREA_HEIGHT_MM             400
109
110 #define DISPENSING_WIDTH_MM             400
111 #define DISPENSING_HEIGHT_MM            1678
112
113 #define PROTECTEDBORDER_WIDTH_MM        22
114 #define PROTECTEDBORDER_HEIGHT_MM       130
115
116 #define PROTECTEDBLOCK_WIDTH_MM         700
117 #define PROTECTEDBLOCK_HEIGHT_MM        120
118
119 #define FIGURE_WIDTH_MM                 200
120
121 #define CORN_DIAMETER_MM        50
122 #define CORN_DIAMETER_M         (CORN_DIAMETER_MM/1000.0)
123 #define CORN_RADIUS_MM          (50/2)
124 #define CORN_RADIUS_M           (CORN_RADIUS_MM/1000.0)
125
126 #define CORN_NEIGHBOURHOOD_RADIUS_MM    220
127 #define CORN_NEIGHBOURHOOD_RADIUS_M     (CORN_NEIGHBOURHOOD_RADIUS_MM/1000.0)
128 /*
129  * 3 ultrasonic beacons
130  */
131 #define BEACON_WIDTH            0.08
132 #define BEACON_HEIGHT           BEACON_WIDTH
133
134 #define BEACON_GREEN            0
135 #define BEACON_RED              1
136 #define BEACON_CNT              3
137
138 /* bonus squares */
139 #define BONUS_CNT               6
140
141 /* pawns */
142 #define PAWN_CNT                15
143
144 /* king */
145 #define KING_CNT                2
146
147 /* queen */
148 #define QUEEN_CNT               2
149
150 struct beacon_pos {
151         float x, y;
152 };
153
154 struct bonus_pos {
155         int x, y;
156 };
157
158 struct pawn_pos {
159         int x, y;
160 };
161
162 struct king_pos {
163         int x, y;
164 };
165
166 struct queen_pos {
167         int x, y;
168 };
169
170 extern const struct beacon_pos beacon_green[BEACON_CNT];
171 extern const struct beacon_pos beacon_red[BEACON_CNT];
172 extern const struct bonus_pos bonus[BONUS_CNT];
173 extern const struct pawn_pos pawn[PAWN_CNT];
174 extern const struct king_pos king[KING_CNT];
175 extern const struct queen_pos queen[QUEEN_CNT];
176
177 /*
178  * Position of Shapr sensors on the robot with respect to the robot center
179  * (not used in EB2009)
180  */
181 struct sharp_pos {
182         float x, y, ang;
183 };
184
185 #define SHARP_COUNT 0  /* no sharp sensors in EB2009, I hope */
186
187 #endif /* ROBODIM_EB2008_H */