2 * robodim_eb2008.h 08/04/18
4 * Dimensions for the robot, playground and other stuffs.
7 * Copyright: (c) 2008 CTU Dragons
8 * CTU FEE - Department of Control Engineering
12 #ifndef ROBODIM_EB2008_H
13 #define ROBODIM_EB2008_H
16 * FIXME: update robot's dimensions !!!
20 * S4 +--------------------------+ S2
22 * ^ | | ------- ABE | |
23 * RR| | | :<--------------------->|
25 * W| | + Center (L)|__| |
26 * | | AB : AF HOK |--,
27 * | |<---->:<----------------->| |
30 * S5 +--------------------------+ S3
37 /* FIXME needs update (?) // comment added by Filip */
38 #define ROBOT_WIDTH_MM 290 /* W*/
39 #define ROBOT_WIDTH_M (ROBOT_WIDTH_MM/1000.0)
40 #define ROBOT_ROTATION_RADIUS_MM (254/2) /* RR */
41 #define ROBOT_ROTATION_RADIUS_M (ROBOT_ROTATION_RADIUS_MM/1000.0)
42 #define LASER_CENTER_OFFSET_MM 50 /*FIXME*/ /* Distance of the laser from rotation axis (Center to L) */
43 #define LASER_CENTER_OFFSET_M (LASER_CENTER_OFFSET_MM/1000.0)
44 #define ROBOT_WHEEL_RADIUS_MM 40 /* WR */
45 #define ROBOT_WHEEL_RADIUS_M (ROBOT_WHEEL_RADIUS_MM/1000.0)
46 #define ROBOT_AXIS_TO_BACK_MM 75 /* AB */
47 #define ROBOT_AXIS_TO_BACK_M (ROBOT_AXIS_TO_BACK_MM/1000.0)
48 #define ROBOT_AXIS_TO_FRONT_MM 183 /* AF */
49 #define ROBOT_AXIS_TO_FRONT_M (ROBOT_AXIS_TO_FRONT_MM/1000.0)
50 #define ROBOT_AXIS_TO_BRUSH_MM 280 /* ABE */
51 #define ROBOT_AXIS_TO_BRUSH_M (ROBOT_AXIS_TO_BRUSH_MM/1000.0)
52 #define HOKUYO_CENTER_OFFSET_MM 0 /*FIXME*/
53 #define HOKUYO_CENTER_OFFSET_M (HOKUYO_CENTER_OFFSET_MM/1000.0)
56 * PLAYGROUND DIMENSIONS
59 * +-------------+-------------+
71 * +-------------+-------------+
73 * <------------------------->
76 #define PLAYGROUND_WIDTH_MM 3000
77 #define PLAYGROUND_WIDTH_M (PLAYGROUND_WIDTH_MM/1000.0)
78 #define PLAYGROUND_HEIGHT_MM 2100
79 #define PLAYGROUND_HEIGHT_M (PLAYGROUND_HEIGHT_MM/1000.0)
82 * PUCK DISPENSERS (= COLUMN ELEMENT DISPENSERS)
84 #define STATIC_DISPENSER_WIDTH_OFFSET 0.289
85 #define DISPENSER_TO_CUSHION_DISTANCE 0.04
86 #define STATIC_DISPENSER_X (PLAYGROUND_WIDTH_M - STATIC_DISPENSER_WIDTH_OFFSET)
87 #define STATIC_DISPENSER_Y DISPENSER_TO_CUSHION_DISTANCE
88 #define TRAVELLING_DISPENSER_X (PLAYGROUND_WIDTH - DISPENSER_TO_CUSHION_DISTANCE)
89 // y coordinate of the travelling dispenser is not known in advance
90 #define OPPONENTS_STATIC_DISPENSER_X STATIC_DISPENSER_WIDTH_OFFSET
91 #define OPPONENTS_STATIC_DISPENSER_Y DISPENSER_TO_CUSHION_DISTANCE
94 * FREE PUCKS POSITIONS
96 #define PUCK_GRID_X_OFFSET 0.6
97 #define PUCK_GRID_Y_OFFSET 0.925
98 #define PUCK_GRID_DELTA_X 0.25
99 #define PUCK_GRID_DELTA_Y 0.2
100 #define PUCK_GRID_ROWS_NUM 4
101 #define PUCK_GRID_COLS_NUM 3
108 * boolean: free_puck_present[lot][ny][nx]
110 extern const char free_puck_present[10][4][3];
113 * tells, whether a puck is placed in grid at nx, ny
114 * (lot=0..9, nx=0..2, ny=0..3)
116 #define FREE_PUCK_PRESENT(lot,nx,ny) (free_puck_present[lot][y][x])
119 * returns position of a free puck
120 * (lot=0..9, nx=0..2, ny=0..3)
122 * !WARNING! The positions assume WE_ARE_GREEN
123 * The pucks are sorted according to growing x, y,
124 * ie. the nearest puck to the start position is @nx=0,ny=3
125 * (yes, a stupid coord system...)
127 static inline struct puck_pos free_puck_pos(int lot, int nx, int ny) {
128 struct puck_pos pos = {PUCK_GRID_X_OFFSET + nx*PUCK_GRID_DELTA_X,
129 PUCK_GRID_Y_OFFSET + ny*PUCK_GRID_DELTA_Y};
136 #define BASKET_WIDTH 0.5
137 #define BASKET_HEIGHT 0.34
138 #define BASKET_VERT_OFFSET 0.35
140 #define BLUE_BASKET_TARGET_X PLAYGROUND_WIDTH_M
141 #define BLUE_BASKET_TARGET_Y (BASKET_WIDTH/2.0)
143 #define RED_BASKET_TARGET_X 0
144 #define RED_BASKET_TARGET_Y (BASKET_WIDTH/2.0)
147 * 3 ultrasonic beacons
149 #define BEACON_WIDTH 0.08
150 #define BEACON_HEIGHT BEACON_WIDTH
152 #define BEACON_GREEN 0
160 extern const struct beacon_pos beacon_green[BEACON_CNT];
161 extern const struct beacon_pos beacon_red[BEACON_CNT];
164 * Position of Shapr sensors on the robot with respect to the robot center
165 * (not used in EB2009)
171 #define SHARP_COUNT 0 /* no sharp sensors in EB2009, I hope */
173 #endif /* ROBODIM_EB2008_H */