add_library(rrts SHARED
src/rrts.cc
+ src/rrtext3.cc
src/rrtext2.cc
src/rrtext1.cc
src/reeds_shepp.cpp
## Implemented extensions
There is a list of implemented extensions and what they include:
+- `rrtext3.cc`: Dijkstra algorithm for path optimization,
- `rrtext2.cc`: [cute c2][] for collision detection,
- `rrtext1.cc`: different cost for building and searching.
// ext2
#include "cute_c2.h"
+/*! \brief Use Dijkstra algorithm to find the shorter path.
+*/
+class RRTExt3 : public virtual RRTS {
+ private:
+ std::vector<RRTNode *> orig_path_;
+ public:
+ std::vector<RRTNode *> &orig_path()
+ {
+ return this->orig_path_;
+ };
+ std::vector<RRTNode *> path();
+};
+
/*! \brief Use cute_c2 for collision detection.
\see https://github.com/RandyGaul/cute_headers/blob/master/cute_c2.h
virtual void deinit();
/*! \brief Return path found by RRT*.
*/
- std::vector<RRTNode *> path();
+ virtual std::vector<RRTNode *> path();
/*! \brief Run next RRT* iteration.
*/
bool next();
--- /dev/null
+#include "rrtext.h"
+
+std::vector<RRTNode *> RRTExt3::path()
+{
+ if (this->orig_path().size() == 0) {
+ this->orig_path_ = RRTS::path();
+ }
+ std::vector<RRTNode *> path;
+ return path;
+}