1 #include "aalgorithm.h"
2 #include "path_simplifier.h"
8 * @defgroup pp Path Planner
11 * Please see path_planner() documentation, the main funtion of the library. For working it needs @link maplib map library @endlink.
12 * Is not necessary to use other functions of the library. However if you are interested, please read @ref ppi
14 * @section pp_algorithms The internal algorithms
15 * The program use an implementation of A* algorithm, aalgorithm() and simplifies it by path_simplifier().
17 * @section pp_example An exemple of using this function:
21 * PathPoint * path; // A pointer to the path
22 * PathPoint * tmp; // A tmp pointer
23 * double angle; // The angle of the final line
24 * double startx, starty, goalx, goaly;
26 * ShmapInit(); //Init shared map memory
28 * // Start and goal points of the path
29 * startx= 1.1; stary=1.1;
30 * goalx= 2.2; goaly = 2.0;
33 * if (path_planner(startx, starty, goalx, goaly, &path, &angle))
34 * printf("Path ok!\n");
36 * printf("The planner can not reach the goal\n");
40 * // Print the points of the trajectory
42 * printf("The points of the trajectory are: ");
43 * while (tmp!= NULL) {
44 * printf("(%f, %f) ", tmp->x, tmp->y);
48 * printf("The final angle is : %f\n", angle);
50 * //Memory deallocation
51 * freePathMemory(path); // Do not forget to free the path memory after use.
53 * ShmapFree(); //Free Shared Map Memory
64 * @name Path Planner Error Codes
67 #define PP_ERROR_MAP_NOT_INIT -1
68 #define PP_ERROR_GOAL_IS_OBSTACLE -2
69 #define PP_ERROR_GOAL_NOT_REACHABLE -3
76 int path_planner(double xstart_real,double ystart_real, double xgoal_real, double ygoal_real , PathPoint ** simple_path, double * angle);
84 * @defgroup ppi Path planer internal functions
85 * @section ppi_arch Path Planer Architecture
86 * PathPlaner is composed of three sublibraries or modules:
87 * - aalgorithm.c : is the implementation of A* Algorithm. More details in aalgorithm().
88 * - path_simplifier.c : The result path of A* is a set of discrete cells (or pixels) that should be simplify. More details in path_simplifier().
89 * - pathqueue.c : It is an implementation of a points queue used by the others modules.