21 #ifndef FOOTSTEP_PLANNER_HELPER_H_ 22 #define FOOTSTEP_PLANNER_HELPER_H_ 37 static const double TWO_PI = 2 * M_PI;
51 return (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2);
74 return (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2);
79 inline double grid_cost(
int x1,
int y1,
int x2,
int y2,
float cell_size)
85 return M_SQRT2 * cell_size;
94 double bin_size_half = M_PI / angle_bin_num;
96 TWO_PI * angle_bin_num);
103 double bin_size = TWO_PI / angle_bin_num;
104 return angle * bin_size;
114 return value >= 0 ? int(value / cell_size) : int(value / cell_size) - 1;
124 return (
double(value) + 0.5) * cell_size;
130 inline int disc_val(
double length,
double cell_size)
132 return int(floor((length / cell_size) + 0.5));
141 inline double cont_val(
int length,
double cell_size)
143 return double(length * cell_size);
178 return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5);
201 double height,
double width,
int accuracy,
213 const std::vector<std::pair<int, int> >& edges);
def normalize_angle_positive(angle)