29 double diff_angle_cost,
30 double max_step_width,
31 double inflation_radius)
32 :
Heuristic(cell_size, num_angle_bins, PATH_COST),
34 ivStepCost(step_cost),
35 ivDiffAngleCost(diff_angle_cost),
36 ivMaxStepWidth(max_step_width),
37 ivInflationRadius(inflation_radius),
75 if ((
unsigned int)
ivGoalX != to_x || (
unsigned int)
ivGoalY != to_y)
77 ROS_ERROR(
"PathCostHeuristic::getHValue to a different value than " 78 "precomputed, heuristic values will be wrong. You need to call " 79 "calculateDistances() before!");
81 assert((
unsigned int)
ivGoalX == to_x && (
unsigned int)
ivGoalY == to_y);
83 double dist = double(
ivGridSearchPtr->getlowerboundoncostfromstart_inmm(
84 from_x, from_y)) / 1000.0;
87 double diff_angle = 0.0;
91 int diff_angle_disc = (
127 SBPL_2DGRIDSEARCH_TERM_CONDITION_ALLCELLS);
145 unsigned width =
ivMapPtr->getInfo().width;
146 unsigned height =
ivMapPtr->getInfo().height;
153 ivpGrid =
new unsigned char* [width];
155 for (
unsigned x = 0; x < width; ++x)
156 ivpGrid[x] =
new unsigned char [height];
157 for (
unsigned y = 0; y < height; ++y)
159 for (
unsigned x = 0; x < width; ++x)
161 float dist =
ivMapPtr->distanceMapAtCell(x,y);
163 ROS_ERROR(
"Distance map at %d %d out of bounds", x, y);
177 int width =
ivMapPtr->getInfo().width;
178 for (
int x = 0; x < width; ++x)
def normalize_angle(angle)