]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Add alternative paths
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Thu, 31 Mar 2022 10:19:21 +0000 (12:19 +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 f77d47670cdd69819fa5efd0e8fc839cbe791858..861a0da6563dba282e4d97bfb4499ab8b3f0a15d 100644 (file)
@@ -156,6 +156,7 @@ main(int argc, char **argv)
                }
        }A
 
+#if 1 /* path1 */
        if (what_plot > 55) {
                c.st(0.0);
                for (int i = 0; i < 10; i++) {
@@ -216,6 +217,170 @@ main(int argc, char **argv)
                        c.next();
                }
        }A
+#endif
+#if 0 /* path2 */
+       if (what_plot > 58) {
+               c.set_max_steer();
+               c.st(c.st() * -1.0);
+               c.sp(0.1);
+               for (int i = 0; i < 10; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 62) {
+               c.set_max_steer();
+               c.st(c.st() * -1.0);
+               c.sp(0.1);
+               for (int i = 0; i < 10; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 66) {
+               c.set_max_steer();
+               c.st(c.st() * -1.0);
+               c.sp(0.1);
+               for (int i = 0; i < 10; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 70) {
+               c.st(0.0);
+               c.sp(-0.1);
+               for (int i = 0; i < 20; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 72) {
+               c.st(0.0);
+               c.sp(-0.1);
+               for (int i = 0; i < 20; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 74) {
+               c.set_max_steer();
+               c.sp(-0.1);
+               for (int i = 0; i < 10; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 76) {
+               c.st(0.0);
+               c.sp(-0.1);
+               for (int i = 0; i < 20; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 78) {
+               c.set_max_steer();
+               c.st(c.st() * -1.0);
+               c.sp(-0.1);
+               for (int i = 0; i < 10; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 80) { // up to 83 (init)
+               int how_much = what_plot - 80;
+               c.st(0.0);
+               c.sp(-0.1);
+               for (int i = 0; i < 20 * how_much; i++) {
+                       c.next();
+               }
+       }A
+#endif
+#if 0 /* path3 */
+       if (what_plot > 56) {
+               c.st(0.0);
+               c.sp(0.1);
+               for (int i = 0; i < 10; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 58) {
+               c.set_max_steer();
+               c.st(c.st() * -1.0);
+               c.sp(0.1);
+               for (int i = 0; i < 10; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 62) {
+               c.set_max_steer();
+               c.st(c.st() * -1.0);
+               c.sp(0.1);
+               for (int i = 0; i < 10; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 66) {
+               c.set_max_steer();
+               c.sp(-0.1);
+               for (int i = 0; i < 5; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 68) {
+               c.set_max_steer();
+               c.sp(-0.1);
+               for (int i = 0; i < 10; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 70) {
+               c.st(0.0);
+               c.sp(-0.1);
+               for (int i = 0; i < 20; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 72) {
+               c.st(0.0);
+               c.sp(-0.1);
+               for (int i = 0; i < 20; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 73) {
+               c.st(0.0);
+               c.sp(-0.1);
+               for (int i = 0; i < 20; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 74) {
+               c.set_max_steer();
+               c.st(c.st() * -1.0);
+               c.sp(-0.1);
+               for (int i = 0; i < 5; i++) {
+                       c.next();
+               }
+       }A
+
+       if (what_plot > 80) { // up to 83 (init)
+               int how_much = what_plot - 80;
+               c.st(0.0);
+               c.sp(-0.1);
+               for (int i = 0; i < 20 * how_much; i++) {
+                       c.next();
+               }
+       }A
+#endif
 
        P(CAR)
        LC = c;