]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robodim/robodim.h
robodim: Add decimal part to all dimension definitions.
[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.0    /* W*/
40 #define ROBOT_WIDTH_M (ROBOT_WIDTH_MM/1000.0)
41 #define ROBOT_ROTATION_RADIUS_MM ((230.0)/2.0) /* RR */
42 #define ROBOT_ROTATION_RADIUS_M (ROBOT_ROTATION_RADIUS_MM/1000.0)
43 #define ROBOT_WHEEL_RADIUS_MM 38.0 /* WR */
44 #define ROBOT_WHEEL_RADIUS_M (ROBOT_WHEEL_RADIUS_MM/1000.0)
45 #define ROBOT_AXIS_TO_BACK_MM 50.0 /* AB */
46 #define ROBOT_AXIS_TO_BACK_M (ROBOT_AXIS_TO_BACK_MM/1000.0)
47 #define ROBOT_AXIS_TO_FRONT_MM 210.0 /* AF */
48 #define ROBOT_AXIS_TO_FRONT_M (ROBOT_AXIS_TO_FRONT_MM/1000.0)
49 #define ROBOT_HEIGHT_MM (ROBOT_AXIS_TO_BACK_MM + ROBOT_AXIS_TO_FRONT_MM)
50 #define ROBOT_HEIGHT_M (ROBOT_HEIGHT_MM / 1000.0)
51
52 #define HOKUYO_CENTER_OFFSET_MM         70.0
53 #define HOKUYO_CENTER_OFFSET_M  (HOKUYO_CENTER_OFFSET_MM/1000.0)
54 #define HOKUYO_RANGE_ANGLE_LEFT  120.0     /* view angle in degrees from center axis */
55 #define HOKUYO_RANGE_ANGLE_RIGHT 120.0
56 #define HOKUYO_ORIENTATION       (-1)   /* 1 = screws up, -1 = screws down */
57
58 #define ODOMETRY_WHEEL_RADIUS_MM 30.0
59 #define ODOMETRY_WHEEL_RADIUS_M (ODOMETRY_WHEEL_RADIUS_MM/1000.0)
60 #define ODOMETRY_ROTATION_RADIUS_MM (284.0/2.0)
61 #define ODOMETRY_ROTATION_RADIUS_M (ODOMETRY_ROTATION_RADIUS_MM/1000.0)
62
63 #define ROBOT_JAWS_LENGHT_MM 130.0 /* JA */
64 #define ROBOT_JAWS_LENGHT_M (ROBOT_JAWS_LENGHT_MM/1000.0)
65 #define ROBOT_LENGHT_WITH_PANWS_MM 170.0 /* PW */ 
66 #define ROBOT_LENGHT_WITH_PAWNS_M (ROBOT_LENGHT_WITH_PANWS_MM/1000.0)
67
68 #define ROBOT_AXIS_TO_FIGURE_CENTER_MM 300.0
69 #define ROBOT_AXIS_TO_FIGURE_CENTER_M (ROBOT_AXIS_TO_FIGURE_CENTER_MM/1000.0)
70
71 #define ROBOT_START_X_MM        ROBOT_AXIS_TO_BACK_MM
72 #define ROBOT_START_X_M         (ROBOT_START_X_MM / 1000.0)
73 #define ROBOT_START_Y_MM        (PLAYGROUND_HEIGHT_MM - (ROBOT_WIDTH_MM / 2.0))
74 #define ROBOT_START_Y_M         (ROBOT_START_Y_MM / 1000.0)
75 #define ROBOT_START_ANGLE_DEG   0
76
77 /* maxon motor parameters ratio */
78 /* DO NOT change this if not shure what you are doing !!! */
79 #define ROBOT_MOTOR_GEARBOX_RATIO       29.0
80 #define ROBOT_MOTOR_IRC_RESOLUTION      512.0
81
82 /**
83  * PLAYGROUND DIMENSIONS
84  *
85  *            S2                                                                  R3
86  *            +---------------------------------+---------------------------------+
87  *        ^   |               |                                              [W,H]|
88  *        |   |    SL_T_R     |                                                   |
89  *        |   |<------------->|                                                   |
90  *        |   |               |                                                   |
91  *        |   |                                                                   |
92  *        |   |                                                                   |
93  *        |   |                                                                   |
94  *        |   |                                                                   |
95  *      H | R1|                                                                   |S1
96  *        |   |                                                                   |
97  *        |   |                                                                   |
98  *        |   |                                                                   |
99  *        |   |                                                                   |
100  *        |   |                                                                   |
101  *        |   |                                                                   |
102  *        |   |                                                                   |
103  *        v   |[0,0]                                                              |
104  *            +---------------------------------+---------------------------------+
105  *            S3                                                                  R2
106  *             <----------------------------------------------------------------->
107  *                                              W
108  */
109 #define PLAYGROUND_WIDTH_MM     3000
110 #define PLAYGROUND_WIDTH_M      (PLAYGROUND_WIDTH_MM/1000.0)
111 #define PLAYGROUND_HEIGHT_MM    2000
112 #define PLAYGROUND_HEIGHT_M     (PLAYGROUND_HEIGHT_MM/1000.0)
113
114 #define SLOPE_TO_RIM_MM         740
115 #define SLOPE_TO_RIM_M          (SLOPE_TO_RIM_MM/1000.0)
116 #define SLOPE_LENGTH_MM         519.23
117 #define SLOPE_LENGTH_M          (SLOPE_LENGTH_MM/1000.0)
118
119 #define SQUARE_WIDTH_MM                 350
120 #define SQUARE_HEIGHT_MM                350
121
122 #define BLINE_WIDTH_MM                  50
123 #define BLINE_HEIGHT_MM                 2100
124
125 #define BLOCK_WIDTH_MM                  400
126 #define BLOCK_HEIGHT_MM                 22
127
128 #define STARTAREA_WIDTH_MM              500
129 #define STARTAREA_HEIGHT_MM             500
130
131 #define DISPENSING_WIDTH_MM             400
132 #define DISPENSING_HEIGHT_MM            1678
133
134 #define PROTECTEDBORDER_WIDTH_MM        22
135 #define PROTECTEDBORDER_HEIGHT_MM       130
136
137 #define PROTECTEDBLOCK_WIDTH_MM         700
138 #define PROTECTEDBLOCK_HEIGHT_MM        120
139
140 #define FIGURE_WIDTH_MM                 200
141
142 #define CORN_DIAMETER_MM        50
143 #define CORN_DIAMETER_M         (CORN_DIAMETER_MM/1000.0)
144 #define CORN_RADIUS_MM          (50/2)
145 #define CORN_RADIUS_M           (CORN_RADIUS_MM/1000.0)
146
147 #define CORN_NEIGHBOURHOOD_RADIUS_MM    220
148 #define CORN_NEIGHBOURHOOD_RADIUS_M     (CORN_NEIGHBOURHOOD_RADIUS_MM/1000.0)
149 /*
150  * 3 ultrasonic beacons
151  */
152 #define BEACON_WIDTH            0.08
153 #define BEACON_HEIGHT           BEACON_WIDTH
154
155 #define BEACON_GREEN            0
156 #define BEACON_RED              1
157 #define BEACON_CNT              3
158
159 /* bonus squares */
160 #define BONUS_CNT               6
161
162 /* pawns */
163 #define PAWN_CNT                15
164
165 /* king */
166 #define KING_CNT                2
167
168 /* queen */
169 #define QUEEN_CNT               2
170
171 #define SQ_CNTR 15
172
173
174 struct beacon_pos {
175         float x, y;
176 };
177
178 struct bonus_pos {
179         int x, y;
180 };
181
182 struct pawn_pos {
183         int x, y;
184 };
185
186 struct king_pos {
187         int x, y;
188 };
189
190 struct queen_pos {
191         int x, y;
192 };
193
194 struct square_center_red {
195         float x, y;
196 };
197
198 struct square_center_blue {
199         float x, y;
200 };
201
202 extern const struct beacon_pos beacon_green[BEACON_CNT];
203 extern const struct beacon_pos beacon_red[BEACON_CNT];
204 extern const struct bonus_pos bonus[BONUS_CNT];
205 extern const struct pawn_pos pawn[PAWN_CNT];
206 extern const struct king_pos king[KING_CNT];
207 extern const struct queen_pos queen[QUEEN_CNT];
208
209 extern const struct square_center_red red_sq[SQ_CNTR];
210 extern const struct square_center_blue blue_sq[SQ_CNTR];
211
212 /*
213  * Position of Shapr sensors on the robot with respect to the robot center
214  * (not used in EB2009)
215  */
216 struct sharp_pos {
217         float x, y, ang;
218 };
219
220 #define SHARP_COUNT 0  /* no sharp sensors in EB2009, I hope */
221
222 #endif /* ROBODIM_EB2008_H */