]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/blob - src/rrtext5.cc
b1fb544dc7c8dac7cde529cd33faecc5726ea9fc
[hubacji1/rrts.git] / src / rrtext5.cc
1 #include "rrtext.h"
2 #include "reeds_shepp.h"
3
4 double RRTExt5::cost_build(RRTNode &f, RRTNode &t)
5 {
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);
10 }
11
12 double RRTExt5::cost_search(RRTNode &f, RRTNode &t)
13 {
14         double cost = 0;
15         cost = sqrt(pow(t.y() - f.y(), 2) + pow(t.x() - f.x(), 2));
16         return cost;
17 }