9 /*! \brief Reeds and Shepp cost for building and search.
11 class RRTExt6 : public virtual RRTS {
13 /*! \brief Reeds and Shepp path length.
15 double cost_build(RRTNode &f, RRTNode &t);
16 /*! \brief Reeds and Shepp path length.
18 double cost_search(RRTNode &f, RRTNode &t);
21 /*! \brief Different costs extension.
23 Use different cost for bulding tree data structure and searching in the
24 structure. This one is complementary to `rrtext1.cc`.
26 class RRTExt5 : public virtual RRTS {
28 /*! \brief Reeds and Shepp path length.
30 double cost_build(RRTNode &f, RRTNode &t);
31 /*! \brief Euclidean distance.
33 double cost_search(RRTNode &f, RRTNode &t);
36 /*! \brief Use grid data structure to store RRT nodes.
38 This approach speeds up the search process for the nearest neighbor and
39 the near vertices procedures.
41 class RRTExt4 : public virtual RRTS {
45 bool changed_ = false;
46 std::vector<RRTNode *> nodes_;
48 void nn(RRTNode *t, RRTNode **nn, RRTS *p);
49 void store_node(RRTNode *n);
54 return this->changed_;
56 std::vector<RRTNode *> &nodes()
63 Cell grid_[100][100]; // [0, 0] is bottom left
64 unsigned int x_min_ = 0;
65 unsigned int x_max_ = 0;
66 unsigned int y_min_ = 0;
67 unsigned int y_max_ = 0;
69 unsigned int xi(RRTNode n);
70 unsigned int yi(RRTNode n);
74 void store_node(RRTNode n);
75 RRTNode *nn(RRTNode &t);
76 std::vector<RRTNode *> nv(RRTNode &t);
79 /*! \brief Use Dijkstra algorithm to find the shorter path.
81 class RRTExt3 : public virtual RRTS {
83 std::vector<RRTNode *> orig_path_;
84 double orig_path_cost_;
86 std::vector<RRTNode *> path();
89 std::vector<RRTNode *> &orig_path()
91 return this->orig_path_;
93 double &orig_path_cost() { return this->orig_path_cost_; }
94 void orig_path_cost(double c) { this->orig_path_cost_ = c; }
97 /*! \brief Use cute_c2 for collision detection.
99 \see https://github.com/RandyGaul/cute_headers/blob/master/cute_c2.h
101 class RRTExt2 : public virtual RRTS {
105 std::vector<c2Poly> c2_obstacles_;
110 // Collide RRT procedures
111 std::tuple<bool, unsigned int, unsigned int>
112 collide_steered_from(RRTNode &f);
114 std::tuple<bool, unsigned int, unsigned int>
115 collide_two_nodes(RRTNode &f, RRTNode &t);
118 c2Poly &c2_bc() { return this->c2_bc_; }
119 c2x &c2x_bc() { return this->c2x_bc_; }
120 std::vector<c2Poly> &c2_obstacles() {
121 return this->c2_obstacles_;
125 /*! \brief Different costs extension.
127 Use different cost for bulding tree data structure and searching in the
130 class RRTExt1 : public virtual RRTS {
132 /*! \brief Reeds and Shepp path length.
134 double cost_build(RRTNode &f, RRTNode &t);
135 /*! \brief Matej's heuristics.
137 double cost_search(RRTNode &f, RRTNode &t);
140 #endif /* RRTEXT_H */