#include "rrtbase.h"
#include "rrtnode.h"
+#define GOALFIRST 1
+
class LaValle1998: public RRTBase {
public:
//using RRTBase::RRTBase;
LaValle1998(RRTNode *init, RRTNode *goal);
+ bool next();
+};
+
+class Kuwata2008: public RRTBase {
+ public:
+ Kuwata2008(RRTNode *init, RRTNode *goal);
+ bool next();
+};
+
+class Karaman2011: public RRTBase {
+ protected:
+ bool connect(
+ RRTNode *pn,
+ RRTNode *ns,
+ std::vector<RRTNode *> nvs);
+ bool rewire(std::vector<RRTNode *> nvs, RRTNode *ns);
+ public:
+ Karaman2011();
+ Karaman2011(RRTNode *init, RRTNode *goal);
+ bool next();
+};
+
+class T1: public RRTBase {
+ public:
+ T1(RRTNode *init, RRTNode *goal);
+ bool next();
+};
+
+class T2: public Karaman2011 {
+ public:
+ using Karaman2011::Karaman2011;
+ bool next();
+ float goal_cost();
+};
+
+class T3: public RRTBase {
+ protected:
+ public:
+ T2 p_root_;
+ T2 p_goal_;
+ ~T3();
+ T3();
+ T3(RRTNode *init, RRTNode *goal);
+ bool next();
+ bool link_obstacles(
+ std::vector<CircleObstacle> *cobstacles,
+ std::vector<SegmentObstacle> *sobstacles);
+ bool connecttrees(RRTNode *rn, RRTNode *gn);
+ bool overlaptrees(RRTNode **ron, RRTNode **gon);
+};
- // RRT framework
- RRTNode *(*nn)(
- RRTNode *root,
- RRTNode *node,
- float (*cost)(RRTNode *, RRTNode *));
- RRTNode *(*sample)();
- std::vector<RRTNode *> (*steer)(
- RRTNode *init,
- RRTNode *goal);
- float (*cost)(RRTNode *init, RRTNode *goal);
+class Klemm2015: public Karaman2011 {
+ private:
+ RRTNode *orig_root_ = nullptr;
+ RRTNode *orig_goal_ = nullptr;
+ protected:
+ int extendstar1(RRTNode *rs, RRTNode **xn);
+ int extendstarC(RRTNode *rs);
+ int connectstar(RRTNode *x);
+ void swap();
+ public:
+ Klemm2015(RRTNode *init, RRTNode *goal);
bool next();
};