delete o.init();
delete o.goal();
}
- for (auto n: p.nodes())
- if (n != p.root())
- delete n;
- for (auto s: p.samples())
- if (s != p.goal())
- delete s;
- delete p.root();
- delete p.goal();
return 0;
}
#include "bcar.h"
#include "rrtbase.h"
+RRTBase::~RRTBase()
+{
+ for (auto n: this->nodes_)
+ if (n != this->root_)
+ delete n;
+ for (auto s: this->samples_)
+ if (s != this->goal_)
+ delete s;
+ delete this->root_;
+ delete this->goal_;
+}
+
RRTBase::RRTBase():
root_(new RRTNode()),
goal_(new RRTNode())
const float GOAL_FOUND_DISTANCE = 0.2;
const float GOAL_FOUND_ANGLE = M_PI / 32;
+ ~RRTBase();
RRTBase();
RRTBase(RRTNode *init, RRTNode *goal);