]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robodim/robodim.h
This is actual state of the robot after competition.
[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 ((230)/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 50 /* AB */
46 #define ROBOT_AXIS_TO_BACK_M (ROBOT_AXIS_TO_BACK_MM/1000.0)
47 #define ROBOT_AXIS_TO_FRONT_MM 250 /* AF */
48 #define ROBOT_AXIS_TO_FRONT_M (ROBOT_AXIS_TO_FRONT_MM/1000.0)
49
50 #define HOKUYO_CENTER_OFFSET_MM 180
51 #define HOKUYO_CENTER_OFFSET_M  (HOKUYO_CENTER_OFFSET_MM/1000.0)
52 #define HOKUYO_RANGE_ANGLE_LEFT  70     /* view angle in degrees from center axis */
53 #define HOKUYO_RANGE_ANGLE_RIGHT 70
54 #define ODOMETRY_WHEEL_RADIUS_MM 30
55 #define ODOMETRY_WHEEL_RADIUS_M (ODOMETRY_WHEEL_RADIUS_MM/1000.0)
56 #define ODOMETRY_ROTATION_RADIUS_MM (284/2)
57 #define ODOMETRY_ROTATION_RADIUS_M (ODOMETRY_ROTATION_RADIUS_MM/1000.0)
58 #define ROBOT_JAWS_LENGHT_MM 105 /* JA */ 
59 #define ROBOT_JAWS_LENGHT_M (ROBOT_JAWS_LENGHT_MM/1000.0)
60 #define ROBOT_LENGHT_WITH_PANWS_MM 170 /* PW */ 
61 #define ROBOT_LENGHT_WITH_PAWNS_M (ROBOT_LENGHT_WITH_PANWS_MM/1000.0)
62 #define ROBOT_AXIS_TO_FIGURE_CENTER_MM 300
63 #define ROBOT_AXIS_TO_FIGURE_CENTER_M (ROBOT_AXIS_TO_FIGURE_CENTER_MM/1000.0)
64
65 /* maxon motor parameters ratio */
66 /* DO NOT change this if not shure what you are doing !!! */
67 #define ROBOT_MOTOR_GEARBOX_RATIO       29.0
68 #define ROBOT_MOTOR_IRC_RESOLUTION      512.0
69
70 /**
71  * PLAYGROUND DIMENSIONS
72  *
73  *            S2                                                                  R3
74  *            +---------------------------------+---------------------------------+
75  *        ^   |               |                                              [W,H]|
76  *        |   |    SL_T_R     |                                                   |
77  *        |   |<------------->|                                                   |
78  *        |   |               |                                                   |
79  *        |   |                                                                   |
80  *        |   |                                                                   |
81  *        |   |                                                                   |
82  *        |   |                                                                   |
83  *      H | R1|                                                                   |S1
84  *        |   |                                                                   |
85  *        |   |                                                                   |
86  *        |   |                                                                   |
87  *        |   |                                                                   |
88  *        |   |                                                                   |
89  *        |   |                                                                   |
90  *        |   |                                                                   |
91  *        v   |[0,0]                                                              |
92  *            +---------------------------------+---------------------------------+
93  *            S3                                                                  R2
94  *             <----------------------------------------------------------------->
95  *                                              W
96  */
97 #define PLAYGROUND_WIDTH_MM     3000
98 #define PLAYGROUND_WIDTH_M      (PLAYGROUND_WIDTH_MM/1000.0)
99 #define PLAYGROUND_HEIGHT_MM    2100
100 #define PLAYGROUND_HEIGHT_M     (PLAYGROUND_HEIGHT_MM/1000.0)
101
102 #define SLOPE_TO_RIM_MM         740
103 #define SLOPE_TO_RIM_M          (SLOPE_TO_RIM_MM/1000.0)
104 #define SLOPE_LENGTH_MM         519.23
105 #define SLOPE_LENGTH_M          (SLOPE_LENGTH_MM/1000.0)
106
107 #define SQUARE_WIDTH_MM                 350
108 #define SQUARE_HEIGHT_MM                350
109
110 #define BLINE_WIDTH_MM                  50
111 #define BLINE_HEIGHT_MM                 2100
112
113 #define BLOCK_WIDTH_MM                  400
114 #define BLOCK_HEIGHT_MM                 22
115
116 #define STARTAREA_WIDTH_MM              400
117 #define STARTAREA_HEIGHT_MM             400
118
119 #define DISPENSING_WIDTH_MM             400
120 #define DISPENSING_HEIGHT_MM            1678
121
122 #define PROTECTEDBORDER_WIDTH_MM        22
123 #define PROTECTEDBORDER_HEIGHT_MM       130
124
125 #define PROTECTEDBLOCK_WIDTH_MM         700
126 #define PROTECTEDBLOCK_HEIGHT_MM        120
127
128 #define FIGURE_WIDTH_MM                 200
129
130 #define CORN_DIAMETER_MM        50
131 #define CORN_DIAMETER_M         (CORN_DIAMETER_MM/1000.0)
132 #define CORN_RADIUS_MM          (50/2)
133 #define CORN_RADIUS_M           (CORN_RADIUS_MM/1000.0)
134
135 #define CORN_NEIGHBOURHOOD_RADIUS_MM    220
136 #define CORN_NEIGHBOURHOOD_RADIUS_M     (CORN_NEIGHBOURHOOD_RADIUS_MM/1000.0)
137 /*
138  * 3 ultrasonic beacons
139  */
140 #define BEACON_WIDTH            0.08
141 #define BEACON_HEIGHT           BEACON_WIDTH
142
143 #define BEACON_GREEN            0
144 #define BEACON_RED              1
145 #define BEACON_CNT              3
146
147 /* bonus squares */
148 #define BONUS_CNT               6
149
150 /* pawns */
151 #define PAWN_CNT                15
152
153 /* king */
154 #define KING_CNT                2
155
156 /* queen */
157 #define QUEEN_CNT               2
158
159 struct beacon_pos {
160         float x, y;
161 };
162
163 struct bonus_pos {
164         int x, y;
165 };
166
167 struct pawn_pos {
168         int x, y;
169 };
170
171 struct king_pos {
172         int x, y;
173 };
174
175 struct queen_pos {
176         int x, y;
177 };
178
179 extern const struct beacon_pos beacon_green[BEACON_CNT];
180 extern const struct beacon_pos beacon_red[BEACON_CNT];
181 extern const struct bonus_pos bonus[BONUS_CNT];
182 extern const struct pawn_pos pawn[PAWN_CNT];
183 extern const struct king_pos king[KING_CNT];
184 extern const struct queen_pos queen[QUEEN_CNT];
185
186 /*
187  * Position of Shapr sensors on the robot with respect to the robot center
188  * (not used in EB2009)
189  */
190 struct sharp_pos {
191         float x, y, ang;
192 };
193
194 #define SHARP_COUNT 0  /* no sharp sensors in EB2009, I hope */
195
196 #endif /* ROBODIM_EB2008_H */