]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Change range for osp
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Mon, 28 Mar 2022 11:21:37 +0000 (13:21 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Mon, 30 May 2022 14:08:42 +0000 (16:08 +0200)
src/gen_for_gnuplot.cc

index ccc1cb760ae69b1825b1ba769194b4c7b694d169..f77d47670cdd69819fa5efd0e8fc839cbe791858 100644 (file)
@@ -16,6 +16,7 @@
 #define INIT_V vector<M> 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();
        }