]> rtime.felk.cvut.cz Git - eurobot/public.git/blobdiff - src/robodim/robodim.h
remove obsolete code in robodim and update fill_in_known_areas_in_map() method
[eurobot/public.git] / src / robodim / robodim.h
index baeeccfe5c070325e39c1936dd756701bae3fd79..5d189d88134d7ae187d4963a5fe9b61994df0b3f 100644 (file)
@@ -1,16 +1,16 @@
 /*
- * robodim_eb2008.h                    08/04/18
+ * robodim_eb2010.h
  *
- * Dimensions for the robot, playground and other stuffs.
- * Eurobot 2008
+ * Dimensions for the robot, playground and other stuff.
+ * Eurobot 2010
  *
- * Copyright: (c) 2008 CTU Dragons
+ * Copyright: (c) 2010 CTU Dragons
  *            CTU FEE - Department of Control Engineering
  * License: GNU GPL v.2
  */
 
-#ifndef ROBODIM_EB2008_H
-#define ROBODIM_EB2008_H
+#ifndef ROBODIM_EB2010_H
+#define ROBODIM_EB2010_H
 
 /**
  * FIXME: update robot's dimensions !!!
@@ -34,7 +34,7 @@
  * Sx - Sharp sensor
  */
 
-/* FIXME needs update (?) // comment added by Filip */
+/* FIXME update robot's dimensions!!! */
 #define ROBOT_WIDTH_MM 290     /* W*/
 #define ROBOT_WIDTH_M (ROBOT_WIDTH_MM/1000.0)
 #define ROBOT_ROTATION_RADIUS_MM (260/2) /* RR */
 #define HOKUYO_CENTER_OFFSET_MM 170
 #define HOKUYO_CENTER_OFFSET_M (HOKUYO_CENTER_OFFSET_MM/1000.0)
 
-#define ROBOT_AXIS_TO_PUCK_M 0.2 // puck approach distance
-#define PUCK_REACHABLE(x) ((x<0.13)?true:false)
-#define PUCK_INSIDE(x) ((x<=0.055)?true:false)
-
 /**
  * PLAYGROUND DIMENSIONS
  * 
  *        ^   |                                                              [W,H]|
  *        |   |                                                                   |
  *        |   |                                                                   |
- *        |   |^                                                                 ^|
- *        |   ||        G    G    G                           G    G    G        ||
- *        |   ||                                                                 ||
- *        |   |O?       G    G    G                           G    G    G        ||
- *        |   ||                                                                 ||
- *      H | R1+|        G    G    G                           G    G    G        |+ S1
- *        |   ||                                                                 ||
- *        |   ||        G    G    G                           G    G    G       ?T|
- *        |   ||                                                                 ||
- *        |   ||                                                                 ||
- *        |   |v                                                                 v|
  *        |   |                                                                   |
  *        |   |                                                                   |
- *        v   |[0,0]  O                                                   S       |
+ *        |   |                                                                   |
+ *        |   |                                                                   |
+ *        |   |                                                                   |
+ *      H | R1|                                                                   |S1
+ *        |   |                                                                   |
+ *        |   |                                                                   |
+ *        |   |                                                                   |
+ *        |   |                                                                   |
+ *        |   |                                                                   |
+ *        |   |                                                                   |
+ *        |   |                                                                   |
+ *        v   |[0,0]                                                              |
  *            +---------------------------------+---------------------------------+
  *            S3                                                                  R2
  *             <----------------------------------------------------------------->
  *                                              W
- *
- *                 G  - grid for pucks
- *                O? - opponent's "travelling" dispenser
- *                O  - opponent's static dispenser
- *                S  - our static dispenser
- *                ?T - our travelling dispenser
- *
  */
 #define PLAYGROUND_WIDTH_MM    3000
 #define PLAYGROUND_WIDTH_M     (PLAYGROUND_WIDTH_MM/1000.0)
 #define PLAYGROUND_HEIGHT_MM   2100
 #define PLAYGROUND_HEIGHT_M    (PLAYGROUND_HEIGHT_MM/1000.0)
 
-#define ACROPOLIS_CENTER_X     (PLAYGROUND_WIDTH_M/2.0)
-#define ACROPOLIS_CENTER_Y     (PLAYGROUND_HEIGHT_M/2.0)
-#define ACROPOLIS_RADIUS       0.15
-#define ACROPOLIS_DIAMETER     (ACROPOLIS_RADIUS*2.0)
-
-/**
- * PUCK DISPENSERS (= COLUMN ELEMENT DISPENSERS)
- */
-#define STATIC_DISPENSER_X_OFFSET      0.289
-#define DISPENSER_TO_CUSHION_DISTANCE  0.04
-#define STATIC_DISPENSER_X             (PLAYGROUND_WIDTH_M - STATIC_DISPENSER_X_OFFSET)
-#define STATIC_DISPENSER_Y             DISPENSER_TO_CUSHION_DISTANCE
-#define TRAVELLING_DISPENSER_X         (PLAYGROUND_WIDTH - DISPENSER_TO_CUSHION_DISTANCE)      // in the "PLAYGROUND DIMENSIONS" ASCII art: O?
-/* y coordinate of the travelling dispenser is not known in advance */
-#define OPPONENTS_STATIC_DISPENSER_X   STATIC_DISPENSER_X_OFFSET                               // in the "PLAYGROUND DIMENSIONS" ASCII art: O
-#define OPPONENTS_STATIC_DISPENSER_Y   DISPENSER_TO_CUSHION_DISTANCE                           // in the "PLAYGROUND DIMENSIONS" ASCII art: O
-
-/**
- * FREE PUCKS POSITIONS
- */
-#define PUCK_GRID_X_OFFSET      0.6
-#define PUCK_GRID_Y_OFFSET      0.925
-#define PUCK_GRID_DELTA_X       0.25
-#define PUCK_GRID_DELTA_Y       0.2
-#define PUCK_GRID_ROWS_NUM      4
-#define PUCK_GRID_COLS_NUM      3
-
-struct puck_pos {
-       float x, y;             /* In meters */
-};
-
-/*
- * boolean: free_puck_present[lot][ny][nx]
- */
-extern const char free_puck_present[10][4][3];
-
-/*
- * tells, whether a puck is placed in grid at nx, ny
- * (lot=0..9, nx=0..2, ny=0..3)
- */
-#define FREE_PUCK_PRESENT(lot,nx,ny) (free_puck_present[lot][y][x])
-
-/*
- * returns position of a free puck
- * (nx=0..2, ny=0..3)
- *
- * !WARNING! The positions assume WE_ARE_GREEN
- * The pucks are sorted according to growing x, y,
- * ie. the nearest puck to the start position is @nx=0,ny=3
- * (yes, a stupid coord system...)
- */
-static inline struct puck_pos free_puck_pos(int nx, int ny) {
-       struct puck_pos pos = {PUCK_GRID_X_OFFSET + nx*PUCK_GRID_DELTA_X,
-                              PUCK_GRID_Y_OFFSET + ny*PUCK_GRID_DELTA_Y};
-       return pos;
-}
-
-/**
- * BASKET
- */
-#define BASKET_WIDTH           0.5
-#define BASKET_HEIGHT          0.34
-#define BASKET_VERT_OFFSET     0.35
-
-#define BLUE_BASKET_TARGET_X   PLAYGROUND_WIDTH_M
-#define BLUE_BASKET_TARGET_Y   (BASKET_WIDTH/2.0)
-
-#define RED_BASKET_TARGET_X    0
-#define RED_BASKET_TARGET_Y    (BASKET_WIDTH/2.0)
-
 /*
  * 3 ultrasonic beacons
  */