]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/pathplan/aalgorithm.h
eb_jaws: Use expansion port number defines + do not use FSM for servo control.
[eurobot/public.git] / src / pathplan / aalgorithm.h
1 /**
2  * @file        aalgorithm.h
3  * @brief       Header file of aalgorithm.c
4  * @author      Jose Maria Martin Laguna <jmmartin@etud.insa-toulouse.fr>
5  *
6 */
7 #ifndef _AALGORITHM_H
8 #define _AALGORITHM_H
9
10 #include <stdbool.h>
11 #ifdef CONFIG_PP_USES_RBTREE
12 #include <rbtree.h>
13 #endif
14
15 /**
16  * Information of a cell in A* Algorithm
17 */
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 */
24         bool in_queue;
25 #ifndef CONFIG_PP_USES_RBTREE
26         struct _GraphMapCell *next; /**< Pointer to the next cell in a list. */
27 #else
28         struct _GraphMapCell *next; /**< Pointer to the next cell in a path. */
29         struct rb_node node;    /**< Red-Black tree data */
30 #endif
31 } GraphMapCell;
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif 
36 void GraphCell2XY(GraphMapCell *c, int *x, int *y);
37 int aAlgorithm(double xstart_real,double ystart_real, double xgoal_real, double ygoal_real, GraphMapCell **original_path);
38 #ifdef __cplusplus
39 }
40 #endif 
41
42 #endif  /* _AALGORITHM_H */