/// ---
struct { double x=0; double y=0; double b=0; double e=0; } entry;
bool entry_set = false;
+ struct { double x=0; double y=0; double h=0; } entry1;
+ struct { double x=0; double y=0; double h=0; } entry2;
+ bool entries_set = false;
std::vector<RRTNode *> steered1_;
std::vector<RRTNode *> steered2_;
/// ---
jvo["entry"][0] = this->goals().front().x();
jvo["entry"][1] = this->goals().front().y();
jvo["entry"][2] = this->goals().front().h();
+ if (this->entry_set) {
+ jvo["entry"][2] = this->entry.b;
+ jvo["entry"][3] = this->entry.e;
+ }
+ if (this->entries_set) {
+ jvo["entries"][0][0] = this->entry1.x;
+ jvo["entries"][0][1] = this->entry1.y;
+ jvo["entries"][0][2] = this->entry1.h;
+ jvo["entries"][1][0] = this->entry2.x;
+ jvo["entries"][1][1] = this->entry2.y;
+ jvo["entries"][1][2] = this->entry2.h;
+ }
jvo["goal"][0] = this->goals().back().x();
jvo["goal"][1] = this->goals().back().y();
jvo["goal"][2] = this->goals().back().h();
this->goals().back().p(gp);
gp = &this->goals().back();
}
+ if (jvi["entries"] != Json::nullValue) {
+ this->entries_set = true;
+ this->entry1.x = jvi["entries"][0][0].asDouble();
+ this->entry1.y = jvi["entries"][0][1].asDouble();
+ this->entry1.h = jvi["entries"][0][2].asDouble();
+ this->entry2.x = jvi["entries"][1][0].asDouble();
+ this->entry2.y = jvi["entries"][1][1].asDouble();
+ this->entry2.h = jvi["entries"][1][2].asDouble();
+ }
for (auto g: jvi["goals"]) {
RRTNode tmp_node;
tmp_node.x(g[0].asDouble());