5 // When the file with precomputed entries is ready.
6 //#include "fiat_punto.h"
20 std::cout << std::fixed;
21 std::cerr << std::fixed;
22 assert(jvi["slot"] != Json::nullValue);
24 jvi["slot"][0][0].asDouble(), jvi["slot"][0][1].asDouble(),
25 jvi["slot"][1][0].asDouble(), jvi["slot"][1][1].asDouble(),
26 jvi["slot"][2][0].asDouble(), jvi["slot"][2][1].asDouble(),
27 jvi["slot"][3][0].asDouble(), jvi["slot"][3][1].asDouble());
30 if (s.parallel() && !s.right()) {
37 pr.reflect(s.entry());
39 // The following uses precomputed entries and needs `"fiat_punto.h"` to
41 //auto pr = get_fiat_punto_entry(s.len(), s.w());
42 //pr = s.recompute_entry(pr);
48 std::vector<bcar::Pose> ispath;
50 while (!c.rf().on_right_side_of(s.entry())) {
55 while (c.lf().on_right_side_of(s.entry())) {
65 for (auto p: s.steer_in_slot(c)) {
70 jvi["goal"][0] = pr.x();
71 jvi["goal"][1] = pr.y();
72 jvi["goal"][2] = pr.b();
73 jvi["goal"][3] = pr.e();
78 for (auto p: ispath) {
79 jvo["ispath"][i][0] = p.x();
80 jvo["ispath"][i][1] = p.y();
81 jvo["ispath"][i][2] = p.h();
84 jvo["icnt"] = p.icnt();
85 jvo["init"] = jvi["init"];
86 jvo["slot"] = jvi["slot"];
87 jvo["obst"] = jvi["obst"];
88 jvo["entry"] = jvi["goal"];
89 jvo["goal"][0] = ispath.back().x();
90 jvo["goal"][1] = ispath.back().y();
91 jvo["goal"][2] = ispath.back().h();
92 std::cout << jvo << std::endl;