3 * @brief Header file of aalgorithm.c
4 * @author Jose Maria Martin Laguna <jmmartin@etud.insa-toulouse.fr>
11 #ifdef CONFIG_PP_USES_RBTREE
16 * Information of a cell in A* Algorithm
18 typedef struct _GraphMapCell {
19 float h; /**< @brief Heuristic cost of shortest path from cell to goal */
20 float f; /**< @brief Estimated cost of shortest path from start to goal */
21 float g; /**< @brief Backpointer length */
22 struct _GraphMapCell *backpointer; /**< Backpointer. */
23 bool processed; /**< @brief Processed flag */
25 #ifndef CONFIG_PP_USES_RBTREE
26 struct _GraphMapCell *next; /**< Pointer to the next cell in a list. */
28 struct _GraphMapCell *next; /**< Pointer to the next cell in a path. */
29 struct rb_node node; /**< Red-Black tree data */
33 //bitmap max. dimension of robot (robodim.h) calculate to cell dimension
34 //TODO calculate automatic
38 #define BITMAP_AB 9 //AB/MAP_CELL_SIZE_MM
39 #define BITMAP_AF 2 //AF/MAP_CELL_SIZE_MM
40 #define BITMAP_W2 6 //W/2/MAP_CELL_SIZE_MM
42 #define BITMAP_AB_ACROSS 6 //AB/MAP_CELL_SIZE_MM
43 #define BITMAP_AF_ACROSS 2 //AF/MAP_CELL_SIZE_MM
44 #define BITMAP_W2_ACROSS 5 //W/2/MAP_CELL_SIZE_MM
56 void GraphCell2XY(GraphMapCell *c, int *x, int *y);
58 int aAlgorithm(double xstart_real,double ystart_real, double xgoal_real, double ygoal_real, GraphMapCell **original_path);
60 int aAlgorithm_shape(double xstart_real,double ystart_real, double xgoal_real, double ygoal_real, double start_angle, double goal_angle, GraphMapCell **original_path);
63 void init_bitmap(bitmap_dim bitmap[], int bitmap_ab, int bitmap_af, int bitmap_w2);
64 bool check_bot_position_straight(int x_0, int y_0, bitmap_dim bitmap_straight[], int angle);
65 bool check_bot_position_across(int x_0, int y_0, bitmap_dim bitmap_across[], int angle);
66 bool check_bot_position(int x_0, int y_0, bitmap_dim bitmap_straight[], bitmap_dim bitmap_across[], int angle
76 #endif /* _AALGORITHM_H */