]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/blobdiff - src/template-with-reset.cc
Merge branch 'fix-steer'
[hubacji1/iamcar2.git] / src / template-with-reset.cc
index c9f3ea044f909638b241f80226ed91c66e5204cd..c1ac6d968f3ebfa5b6834e2e562936cbe598825b 100644 (file)
@@ -28,6 +28,28 @@ int main()
                jvi["slot"][2][0].asDouble(), jvi["slot"][2][1].asDouble(),
                jvi["slot"][3][0].asDouble(), jvi["slot"][3][1].asDouble());
        bcar::BicycleCar c;
+       // wang 2017
+       //c.ctc(8.411896337925237);
+       //c.w(1.81);
+       //c.wb(2.7);
+       //c.df(3.7);
+       //c.len(4.85);
+       // jhang 2020 https://en.wikipedia.org/wiki/Chrysler_Pacifica_(minivan)
+       //c.ctc(9.557619159602458);
+       //c.w(2.022);
+       //c.wb(3.089);
+       //c.df(4.236);
+       //c.len(5.171);
+       // feng 2018
+       //p.eta(0.1);
+       // PES Porsche Cayenne
+       //c.ctc(11.2531); // this is guess
+       //c.w(1.983);
+       //c.wb(2.895);
+       //c.df(2.895 + 0.9); // this is guess
+       //c.len(4.918);
+       c.become("porsche cayenne");
+
        bool swapped = false;
        if (s.parallel() && !s.right()) {
                s.swap_side();
@@ -38,7 +60,7 @@ int main()
                s.swap_side();
                pr.reflect(s.entry());
        }
-       std::cerr << ip_time.scnt() << std::endl;
+       //std::cerr << ip_time.scnt() << std::endl;
        // The following uses precomputed entries and needs `"fiat_punto.h"` to
        // be included.
        //auto pr = get_fiat_punto_entry(s.len(), s.w());
@@ -62,12 +84,8 @@ int main()
        }
        if (s.parallel()) {
                c.set_max_steer();
-               if (!s.right()) {
-                       c.st(c.st() * -1.0);
-               }
-               for (auto p: s.steer_in_slot(c)) {
-                       c.next();
-                       ispath.push_back(c);
+               for (auto &n : s.drive_in_slot(c)) {
+                       ispath.push_back(n);
                }
        }
        jvi["goal"][0] = pr.x();
@@ -77,6 +95,37 @@ int main()
        jvi["goal_inside"][0] = ispath.back().x();
        jvi["goal_inside"][1] = ispath.back().y();
        jvi["goal_inside"][2] = ispath.back().h();
+
+       // Opel Corsa
+       //p.bc().ctc(9.900);
+       //p.bc().w(1.532);
+       //p.bc().wb(2.343);
+       //p.bc().df(3.212);
+       //p.bc().len(3.622);
+       // wang 2017
+       //p.bc().ctc(8.411896337925237);
+       //p.bc().w(1.81);
+       //p.bc().wb(2.7);
+       //p.bc().df(3.7);
+       //p.bc().len(4.85);
+       // jhang 2020 https://en.wikipedia.org/wiki/Chrysler_Pacifica_(minivan)
+       //p.bc().ctc(9.557619159602458);
+       //p.bc().w(2.022);
+       //p.bc().wb(3.089);
+       //p.bc().df(4.236);
+       //p.bc().len(5.171);
+       //p.eta(0.3);
+       // feng 2018
+       //p.eta(0.1);
+       // PES Porsche Cayenne
+       //p.bc().ctc(11.2531); // this is guess
+       //p.bc().w(1.983);
+       //p.bc().wb(2.895);
+       //p.bc().df(2.895 + 0.9); // this is guess
+       //p.bc().len(4.918);
+       //p.eta(0.1);
+       p.set_bc_to_become("porsche cayenne");
+
        p.json(jvi);
        unsigned int icnt = 0;
        unsigned int rcnt = 0;
@@ -85,6 +134,7 @@ int main()
        Json::Value best_path;
        Json::Value pj;
        double cost = 0.0;
+       p.reset();
        while (icnt < 1000) {
                p.icnt(icnt);
                while (p.next()) {}
@@ -129,6 +179,7 @@ int main()
        jvo["time"] = elapsed;
        jvo["icnt"] = p.icnt();
        jvo["rcnt"] = rcnt;
+       jvo["ncnt"] = ncnt;
        jvo["bcnt"] = bcnt;
        jvo["path"] = best_path;
        jvo["goal_cc"] = cost;