42 namespace planner_2dof_serial_joints
45 const Vecf& euclid_cost_coef,
50 : euclid_cost_coef_(euclid_cost_coef)
51 , resolution_(resolution)
56 for (
Vec p(-range, -range); p[0] <= range; p[0]++)
58 for (p[1] = -range; p[1] <= range; p[1]++)
68 for (
int i = 0; i < 2; i++)
75 const Vec& cur,
const Vec& next,
const std::vector<VecWithCost>& start,
const Vec& goal)
const
77 if ((
unsigned int)next[0] >= (
unsigned int)
resolution_ * 2 ||
78 (
unsigned int)next[1] >= (
unsigned int)
resolution_ * 2)
85 float distf = std::hypot(
static_cast<float>(
d[0]),
static_cast<float>(
d[1]));
88 const int dist = distf;
92 dp[0] =
static_cast<float>(
d[0]) / dist;
93 dp[1] =
static_cast<float>(
d[1]) / dist;
95 for (
int i = 0; i < dist; i++)
97 pos[0] = std::lround(v[0]);
98 pos[1] = std::lround(v[1]);
100 const auto c =
cm_[pos];
112 const Vec& cur,
const Vec& goal)
const
114 const Vec d = goal - cur;
119 const std::vector<VecWithCost>& ss,