]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/blobdiff - api/rrts.h
Allow using the jsoncpp library installed in non-default locations
[hubacji1/rrts.git] / api / rrts.h
index f5b7de580eb2ecf6da17bd34efe1b4cb9e750fd1..42724d73740a1d7fcedd6b5c6ce59efc13a05a5a 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <chrono>
 #include <functional>
-#include <jsoncpp/json/json.h>
+#include <json/json.h>
 #include <random>
 #include <vector>
 #include "bcar.h"
@@ -147,6 +147,7 @@ class RRTS {
                 std::vector<Obstacle> obstacles_;
                 std::vector<RRTNode> samples_;
                 std::vector<RRTNode> steered_;
+                std::vector<RRTNode *> path_;
                 double log_path_time_ = 0.1;
                 unsigned int log_path_iter_ = 20;
 
@@ -233,12 +234,17 @@ class RRTS {
                 /*! \brief Initialize RRT algorithm if needed.
                 */
                 virtual void init();
+                virtual void reset();
                 /*! \brief Deinitialize RRT algorithm if needed.
                 */
                 virtual void deinit();
                 /*! \brief Return path found by RRT*.
                 */
-                virtual std::vector<RRTNode *> path();
+                virtual std::vector<RRTNode *>& path()
+                {
+                        return this->path_;
+                }
+                virtual void compute_path();
                 /*! \brief Return ``true`` if algorithm should stop.
 
                 Update counters (iteration, seconds, ...) and return if