- Compound extensions.
- Dijkstra algorithm for path optimization (`rrtext3.cc`).
- Grid based `nn` and `nv` methods (`rrtext4.cc`).
+- Compound extensions.
[cute c2]: https://github.com/RandyGaul/cute_headers/blob/master/cute_c2.h
add_library(rrts SHARED
src/rrts.cc
+ src/rrtext6.cc
+ src/rrtext5.cc
src/rrtext4.cc
src/rrtext3.cc
src/rrtext2.cc
## Implemented extensions
There is a list of implemented extensions and what they include:
+- `rrtext6.cc`: Reeds and Shepp for both -- building and search costs,
+- `rrtext5.cc`: different cost for building (Reeds and Shepp) and searching
+ (Euclidean distance),
- `rrtext4.cc`: store RRT nodes to grid,
- `rrtext3.cc`: Dijkstra algorithm for path optimization,
- `rrtext2.cc`: [cute c2][] for collision detection,
-- `rrtext1.cc`: different cost for building and searching.
+- `rrtext1.cc`: different cost for building (Reeds and Shepp) and searching
+ (Matej's heuristics).
[cute c2]: https://github.com/RandyGaul/cute_headers/blob/master/cute_c2.h
## Compound extensions
There is a list of classes with reference to extensions used:
- `RRTCE1`: 1, 2.
+- `RRTCE2`: 2, 5.
+- `RRTCE3`: 2, 6.
# Contribute
Use [OneFlow][3] branching model and keep the [changelog][4].
#include "rrtext.h"
class RRTCE1 : public RRTExt1, public RRTExt2 {};
+class RRTCE2 : public RRTExt2, public RRTExt5 {};
+class RRTCE3 : public RRTExt2, public RRTExt6 {};
#endif /* RRTCE_H */
// ext2
#include "cute_c2.h"
+/*! \brief Reeds and Shepp cost for building and search.
+*/
+class RRTExt6 : public virtual RRTS {
+ public:
+ /*! \brief Reeds and Shepp path length.
+ */
+ double cost_build(RRTNode &f, RRTNode &t);
+ /*! \brief Reeds and Shepp path length.
+ */
+ double cost_search(RRTNode &f, RRTNode &t);
+};
+
+/*! \brief Different costs extension.
+
+Use different cost for bulding tree data structure and searching in the
+structure. This one is complementary to `rrtext1.cc`.
+*/
+class RRTExt5 : public virtual RRTS {
+ public:
+ /*! \brief Reeds and Shepp path length.
+ */
+ double cost_build(RRTNode &f, RRTNode &t);
+ /*! \brief Euclidean distance.
+ */
+ double cost_search(RRTNode &f, RRTNode &t);
+};
+
/*! \brief Use grid data structure to store RRT nodes.
This approach speeds up the search process for the nearest neighbor and
--- /dev/null
+#include "rrtext.h"
+#include "reeds_shepp.h"
+
+double RRTExt5::cost_build(RRTNode &f, RRTNode &t)
+{
+ double q0[] = {f.x(), f.y(), f.h()};
+ double q1[] = {t.x(), t.y(), t.h()};
+ ReedsSheppStateSpace rsss(f.mtr());
+ return rsss.distance(q0, q1);
+}
+
+double RRTExt5::cost_search(RRTNode &f, RRTNode &t)
+{
+ double cost = 0;
+ cost = sqrt(pow(t.y() - f.y(), 2) + pow(t.x() - f.x(), 2));
+ return cost;
+}
--- /dev/null
+#include "rrtext.h"
+#include "reeds_shepp.h"
+
+double RRTExt6::cost_build(RRTNode &f, RRTNode &t)
+{
+ double q0[] = {f.x(), f.y(), f.h()};
+ double q1[] = {t.x(), t.y(), t.h()};
+ ReedsSheppStateSpace rsss(f.mtr());
+ return rsss.distance(q0, q1);
+}
+
+double RRTExt6::cost_search(RRTNode &f, RRTNode &t)
+{
+ double q0[] = {f.x(), f.y(), f.h()};
+ double q1[] = {t.x(), t.y(), t.h()};
+ ReedsSheppStateSpace rsss(f.mtr());
+ return rsss.distance(q0, q1);
+}