RRTBase::RRTBase():
root_(new RRTNode()),
- goal_(new RRTNode())
+ goal_(new RRTNode()),
+ gen_(std::random_device{}())
{
this->nodes_.reserve(NOFNODES);
this->nodes_.push_back(this->root_);
RRTBase::RRTBase(RRTNode *init, RRTNode *goal):
root_(init),
- goal_(goal)
+ goal_(goal),
+ gen_(std::random_device{}())
{
this->nodes_.reserve(NOFNODES);
this->nodes_.push_back(init);
#include <chrono>
#include <cmath>
#include <pthread.h>
+#include <random>
#include <vector>
#include "obstacle.h"
#include "rrtnode.h"
std::vector<float> slog_; // seconds of trajectories
std::vector<std::vector<RRTNode *>> tlog_; // trajectories
std::vector<RRTNode *> slot_cusp_; // cusp nodes in slot
+
+ std::default_random_engine gen_;
public:
const float GOAL_FOUND_DISTANCE = 0.2;
const float GOAL_FOUND_ANGLE = M_PI / 32;