]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/commitdiff
Add deinit methods
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Fri, 8 Nov 2019 16:58:35 +0000 (17:58 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Fri, 3 Jan 2020 14:10:13 +0000 (15:10 +0100)
This will be used when reset of planner is needed.

CHANGELOG.md
src/rrtext2.cc
src/rrts.cc

index 8506220f8363f3a9d39ac231242c2e96362e1772..757987467d397a131b26024a3a403543e03acfe6 100644 (file)
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog][] and this project adheres to
 - Compound extensions.
 - JSON output.
 - Should continue method.
+- Deinit method -- get ready for planner reset.
 
 [cute c2]: https://github.com/RandyGaul/cute_headers/blob/master/cute_c2.h
 
index e90f3eb89eb238ac5a075bd6817b33278169b720..38b1905ed603d5657b3998db54638c7678060706 100644 (file)
@@ -35,6 +35,8 @@ void RRTExt2::init()
 
 void RRTExt2::deinit()
 {
+        this->c2_obstacles().clear();
+        RRTS::deinit();
 }
 
 std::tuple<bool, unsigned int, unsigned int>
index 024952ae57d190cb07d4fb340689d9ca37f75788..18dbcca7e81eea4acd8c7d4b05539b61a8e0caae 100644 (file)
@@ -260,6 +260,14 @@ void RRTS::init()
 
 void RRTS::deinit()
 {
+        this->nodes().clear();
+        this->samples().clear();
+        this->steered().clear();
+        this->store_node(RRTNode()); // root
+        this->icnt_ = 0;
+        this->scnt_ = 0;
+        this->pcnt_ = 0;
+        this->gf_ = false;
 }
 
 std::vector<RRTNode *> RRTS::path()