8 : ReachabilityPlugin(
"reachability_polygon")
9 , ivpStepRange(nullptr)
21 if (!ReachabilityPlugin::loadParams(params))
25 params.getParam(
"collision_check/cell_size",
cell_size);
26 params.getParam(
"collision_check/num_angle_bins", num_angle_bins);
30 std::vector<std::pair<int, int> > step_range;
34 if (!params.getParam(
"step_range/x", step_range_x) || !params.getParam(
"step_range/y", step_range_y))
36 ROS_ERROR(
"Can't initialize ReachabilityPolygon due to missing step_range in parameter set!");
40 assert((step_range_x.
size() == step_range_y.
size()) && (step_range_x.
size() > 0));
44 step_range.reserve(step_range_x.
size());
46 for (
int i = 0; i < step_range_x.
size(); i++)
48 double x =
static_cast<double>(step_range_x[i]);
49 double y =
static_cast<double>(step_range_y[i]);
51 step_range.push_back(std::pair<int, int>(disc_val(x,
cell_size), disc_val(y,
cell_size)));
83 for (
int y = max_step_range_inv_y_disc; y <= max_step_range_y_disc; y++)
85 msg += boost::lexical_cast<std::string>(y) +
": ";
86 for (
int x = max_step_range_inv_x_disc; x <= max_step_range_x_disc; x++)
89 msg += pointWithinPolygon(x, y, step_range) ?
"+ " :
"- ";
100 if (current.getLeg() == next.getLeg())
107 tf::Transform step = current.getPose().inverse() * next.getPose();
108 double dx = step.getOrigin().x();
109 double dy = step.getOrigin().y();
110 double dyaw = angles::shortest_angular_distance(current.getYaw(), next.getYaw());
113 if (current.getLeg() == LEFT)
140 if (!
ivpStepRange[footstep_x + footstep_y * step_range_size_x])
147 #include <pluginlib/class_list_macros.h>