-int aAlgorithm_shape(double xstart_real,double ystart_real, double xgoal_real, double ygoal_real, GraphMapCell **original_path)
+int aAlgorithm_shape(double xstart_real, double ystart_real, double xgoal_real, double ygoal_real, double start_angle, double goal_angle, GraphMapCell **original_path)
{
/**
* prioritySet : Set of nodes to process order by heuristic distance
int aAlgorithm(double xstart_real,double ystart_real, double xgoal_real, double ygoal_real, GraphMapCell **original_path);
-int aAlgorithm_shape(double xstart_real,double ystart_real, double xgoal_real, double ygoal_real, GraphMapCell **original_path);
+int aAlgorithm_shape(double xstart_real,double ystart_real, double xgoal_real, double ygoal_real, double start_angle, double goal_angle, GraphMapCell **original_path);
#ifdef TESTBITMAPS
void init_bitmap(bitmap_dim bitmap[], int bitmap_ab, int bitmap_af, int bitmap_w2);
*/
-int path_planner(double xstart_real,double ystart_real, double xgoal_real, double ygoal_real , PathPoint ** simple_path, double * angle, enum _astar_method astar_method)
+int path_planner(double xstart_real,double ystart_real, double xgoal_real, double ygoal_real , PathPoint ** simple_path, double * start_angle, double * goal_angle, enum _astar_method astar_method)
{
int nbpoints, count;
int ret;
nbpoints = aAlgorithm(xstart_real,ystart_real, xgoal_real, ygoal_real, &astar_path);
}
else{
- nbpoints = aAlgorithm_shape(xstart_real,ystart_real, xgoal_real, ygoal_real, &astar_path);
+ nbpoints = aAlgorithm_shape(xstart_real,ystart_real, xgoal_real, ygoal_real, *start_angle, *goal_angle, &astar_path);
}
if (nbpoints < 0) {
// DBG("Simplifing the path\n");
// Calc a simplest path
(*simple_path) = (PathPoint *) malloc(sizeof(PathPoint));
- count = path_simplifier(original_path, nbpoints, *simple_path, angle);
+ count = path_simplifier(original_path, nbpoints, *simple_path, goal_angle);
// Do not send the first point
tmp=(*simple_path);
(*simple_path)= (*simple_path)->next;
extern "C" {
#endif
- int path_planner(double xstart_real, double ystart_real, double xgoal_real, double ygoal_real, PathPoint** simple_path, double* angle, enum _astar_method astar_method);
+ int path_planner(double xstart_real, double ystart_real, double xgoal_real, double ygoal_real, PathPoint** simple_path, double* start_angle , double* goal_angle, enum _astar_method astar_method);
#ifdef __cplusplus
}
// Where to start trajectory planning?
get_future_pos(start_in_future, future_traj_point, time_ts);
Point start(future_traj_point.x, future_traj_point.y);
-
+ double start_angle = future_traj_point.phi;
Trajectory *t = new Trajectory(move_target->tc, backward);
/*
if (move_target->use_planning) {
/// Calculates the path between actual position to goal position. If the goal is not reachable returns -1.
- switch (path_planner(start.x, start.y, target.x, target.y, &path, &angle, ASTAR_METHOD_SHAPE)) {
+ switch (path_planner(start.x, start.y, target.x, target.y, &path, &start_angle, &angle, ASTAR_METHOD_SHAPE)) {
case PP_ERROR_MAP_NOT_INIT:
ret = TARGET_ERROR; break;
case PP_ERROR_GOAL_IS_OBSTACLE: