From: Jiri Vlasak Date: Mon, 28 Mar 2022 11:21:37 +0000 (+0200) Subject: Change range for osp X-Git-Url: https://rtime.felk.cvut.cz/gitweb/hubacji1/bcar.git/commitdiff_plain/8fde563a6cbde09734be492a197a373b429a61f9 Change range for osp --- diff --git a/src/gen_for_gnuplot.cc b/src/gen_for_gnuplot.cc index ccc1cb7..f77d476 100644 --- a/src/gen_for_gnuplot.cc +++ b/src/gen_for_gnuplot.cc @@ -16,6 +16,7 @@ #define INIT_V vector V; #define P(W) V.push_back(M(#W)); V.back().o.W = true; #define LC V.back().c +#define A {}// P(CAR_POINT) LC = c; class M { public: @@ -69,7 +70,7 @@ public: swap(*this, m); } }; -unsigned int M::cntr = 0; +unsigned int M::cntr = 10; void gpl_slot(bcar::ParkingSlot& s, std::string fn = "") @@ -116,6 +117,7 @@ main(int argc, char **argv) using namespace std; if (argc != 2) { cerr << "Specify `what_plot` number." << endl; + // what_plot values 50 - 72 correspond to OSP exit(1); } cout << fixed; @@ -130,90 +132,94 @@ main(int argc, char **argv) int what_plot = atoi(argv[1]); + INIT_V + // this is ep int len = s._ispaths.size(); auto c = s._ispaths[len / 2].front(); - if (what_plot > 2) { + A + + if (what_plot > 52) { c.set_max_steer(); c.sp(0.1); for (int i = 0; i < 5; i++) { c.next(); } - } + }A - if (what_plot > 4) { // can go anywhere forward + if (what_plot > 54) { // can go anywhere forward c.set_max_steer(); c.sp(0.1); while (!s.lf().inside_of(c.ccr(), c.iradi())) { c.next(); } - } + }A - if (what_plot > 5) { + if (what_plot > 55) { c.st(0.0); for (int i = 0; i < 10; i++) { c.next(); } - } + }A - if (what_plot > 6) { + if (what_plot > 56) { c.st(0.0); for (int i = 0; i < 10; i++) { c.next(); } - } + }A - if (what_plot > 7) { + if (what_plot > 57) { c.st(0.0); for (int i = 0; i < 10; i++) { c.next(); } - } + }A - if (what_plot > 8) { // few steps towards -- most up + if (what_plot > 58) { // few steps towards -- most up c.st(0.0); for (int i = 0; i < 10; i++) { c.next(); } - } + }A - if (what_plot > 10) { + if (what_plot > 60) { c.set_max_steer(); c.sp(-0.1); for (int i = 0; i < 10; i++) { c.next(); } - } + }A - if (what_plot > 11) { + if (what_plot > 61) { c.set_max_steer(); c.sp(-0.1); for (int i = 0; i < 10; i++) { c.next(); } - } + }A - if (what_plot > 12) { // parallel to ps + if (what_plot > 62) { // parallel to ps c.set_max_steer(); c.sp(-0.1); for (int i = 0; i < 10; i++) { c.next(); } - } + }A - if (what_plot > 16) { // what_plot should be up to 22 (init) - int how_much = what_plot - 16; + if (what_plot > 66) { // what_plot should be up to 22 (init) + int how_much = what_plot - 16 - 50; c.st(0.0); c.sp(-0.1); for (int i = 0; i < 20 * how_much; i++) { c.next(); } - } + }A - INIT_V P(CAR) LC = c; + for (auto& m: V) { m.gpl(); }