2 #include "reeds_shepp.h"
4 double RRTExt1::cost_build(RRTNode &f, RRTNode &t)
6 double q0[] = {f.x(), f.y(), f.h()};
7 double q1[] = {t.x(), t.y(), t.h()};
8 ReedsSheppStateSpace rsss(this->bc.mtr());
9 return rsss.distance(q0, q1);
12 double RRTExt1::cost_search(RRTNode &f, RRTNode &t)
15 cost = sqrt(pow(t.y() - f.y(), 2) + pow(t.x() - f.x(), 2));
16 double heur = std::min(
17 std::abs(t.h() - f.h()),
18 2 * M_PI - std::abs(t.h() - f.h())
20 heur *= this->bc.mtr();
21 cost = std::max(cost, heur);