]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robodim/robodim.h
robodim: update robot starting position
[eurobot/public.git] / src / robodim / robodim.h
1 /*
2  * robodim.h
3  *
4  * Dimensions for the robot, playground and other stuff.
5  * Demo application
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 ROBODIMH
13 #define ROBODIMH
14
15 /**
16  * FIXME: update robot's dimensions !!!
17  *        and update the pitcture
18  *
19  * ROBOT DIMENSIONS
20  *
21  *        ^ +--------------------------+
22  *        | |   |     |                |
23  *     ^  | |   -------                |
24  *   RR|  | |      :                   |
25  *     v  | |      :             __    |
26  *       W| |      + Center     |__|   |
27  *        | |  AB  :       AF    HOK   |
28  *        | |<---->:<----------------->|
29  *        | |   -------                |
30  *        | |   |     |                |
31  *        v +--------------------------+
32  * <------->       <-->
33  *     V            WR
34  *
35  */
36
37 #define ROBOT_WIDTH_MM 280      /* W*/
38 #define ROBOT_WIDTH_M (ROBOT_WIDTH_MM/1000.0)
39 #define ROBOT_ROTATION_RADIUS_MM ((230.0)/2.0) /* RR */
40 #define ROBOT_ROTATION_RADIUS_M (ROBOT_ROTATION_RADIUS_MM/1000.0)
41 #define ROBOT_WHEEL_RADIUS_MM 38.0 /* WR */
42 #define ROBOT_WHEEL_RADIUS_M (ROBOT_WHEEL_RADIUS_MM/1000.0)
43 #define ROBOT_AXIS_TO_BACK_MM 50.0 /* AB */
44 #define ROBOT_AXIS_TO_BACK_M (ROBOT_AXIS_TO_BACK_MM/1000.0)
45 #define ROBOT_AXIS_TO_FRONT_MM 210.0 /* AF */
46 #define ROBOT_AXIS_TO_FRONT_M (ROBOT_AXIS_TO_FRONT_MM/1000.0)
47 #define ROBOT_HEIGHT_MM (ROBOT_AXIS_TO_BACK_MM + ROBOT_AXIS_TO_FRONT_MM)
48 #define ROBOT_HEIGHT_M (ROBOT_HEIGHT_MM / 1000.0)
49
50 #define HOKUYO_CENTER_OFFSET_MM         180.0
51 #define HOKUYO_CENTER_OFFSET_M  (HOKUYO_CENTER_OFFSET_MM/1000.0)
52 #define HOKUYO_RANGE_ANGLE_LEFT  70.0     /* view angle in degrees from center axis */
53 #define HOKUYO_RANGE_ANGLE_RIGHT 70.0
54 #define HOKUYO_ORIENTATION       (1)   /* 1 = screws up, -1 = screws down */
55
56 #define SICK_CENTER_OFFSET_MM         180.0
57 #define SICK_CENTER_OFFSET_M  (SICK_CENTER_OFFSET_MM/1000.0)
58 #define SICK_RANGE_ANGLE_LEFT  135.0     /* view angle in degrees from center axis */
59 #define SICK_RANGE_ANGLE_RIGHT 135.0
60 #define SICK_ORIENTATION       (1)   /* 1 = screws up, -1 = screws down */
61
62 #define ODOMETRY_WHEEL_RADIUS_MM 30.0
63 #define ODOMETRY_WHEEL_RADIUS_M (ODOMETRY_WHEEL_RADIUS_MM/1000.0)
64 #define ODOMETRY_ROTATION_RADIUS_MM (284.0/2.0)
65 #define ODOMETRY_ROTATION_RADIUS_M (ODOMETRY_ROTATION_RADIUS_MM/1000.0)
66 #define ROBOT_DIAGONAL_RADIUS_MM sqrt((ROBOT_WIDTH_MM*ROBOT_WIDTH_MM/4) + (ROBOT_AXIS_TO_FRONT_MM*ROBOT_AXIS_TO_FRONT_MM))
67 #define ROBOT_DIAGONAL_RADIUS_M (ROBOT_DIAGONAL_RADIUS_MM/1000.0)
68
69 #define ROBOT_JAWS_LENGHT_MM 130.0 /* JA */
70 #define ROBOT_JAWS_LENGHT_M (ROBOT_JAWS_LENGHT_MM/1000.0)
71 #define ROBOT_LENGHT_WITH_PANWS_MM 170.0 /* PW */ 
72 #define ROBOT_LENGHT_WITH_PAWNS_M (ROBOT_LENGHT_WITH_PANWS_MM/1000.0)
73
74 #define ROBOT_AXIS_TO_FIGURE_CENTER_MM 300.0
75 #define ROBOT_AXIS_TO_FIGURE_CENTER_M (ROBOT_AXIS_TO_FIGURE_CENTER_MM/1000.0)
76
77 #define ROBOT_START_X_MM        (ROBOT_WIDTH_MM / 2.0 + 50.0)
78 #define ROBOT_START_X_M         (ROBOT_START_X_MM / 1000.0)
79 #define ROBOT_START_Y_MM        (ROBOT_AXIS_TO_BACK_MM + 150.0)
80 #define ROBOT_START_Y_M         (ROBOT_START_Y_MM / 1000.0)
81 #define ROBOT_START_ANGLE_DEG   90
82
83 /* maxon motor parameters ratio */
84 /* DO NOT change this if not shure what you are doing !!! */
85 #define ROBOT_MOTOR_GEARBOX_RATIO       29.0
86 #define ROBOT_MOTOR_IRC_RESOLUTION      512.0
87
88 /**
89  * PLAYGROUND DIMENSIONS
90  */
91 #define PLAYGROUND_WIDTH_MM     1400
92 #define PLAYGROUND_WIDTH_M      (PLAYGROUND_WIDTH_MM/1000.0)
93 #define PLAYGROUND_HEIGHT_MM    2800
94 #define PLAYGROUND_HEIGHT_M     (PLAYGROUND_HEIGHT_MM/1000.0)
95
96 /**
97  * TARGET DIMENSIONS
98  */
99 #define TARGET_RADIUS_MM     125
100 #define TARGET_RADIUS_M      (TARGET_RADIUS_MM/1000.0)
101
102 struct sharp_pos {
103         float x, y, ang;
104 };
105
106 #endif /* ROBODIMH */