5 #include "fiat_punto.h"
19 std::cout << std::fixed;
20 std::cerr << std::fixed;
21 assert(jvi["slot"] != Json::nullValue);
23 jvi["slot"][0][0].asDouble(), jvi["slot"][0][1].asDouble(),
24 jvi["slot"][1][0].asDouble(), jvi["slot"][1][1].asDouble(),
25 jvi["slot"][2][0].asDouble(), jvi["slot"][2][1].asDouble(),
26 jvi["slot"][3][0].asDouble(), jvi["slot"][3][1].asDouble());
29 if (s.parallel() && !s.right()) {
36 pr.reflect(s.entry());
38 // The following uses precomputed entries and needs `"fiat_punto.h"` to
40 //auto pr = get_fiat_punto_entry(s.len(), s.w());
41 //pr = s.recompute_entry(pr);
47 std::vector<bcar::Pose> ispath;
49 while (!c.rf().on_right_side_of(s.entry())) {
54 while (c.lf().on_right_side_of(s.entry())) {
64 for (auto p: s.steer_in_slot(c)) {
69 jvi["goal"][0] = pr.x();
70 jvi["goal"][1] = pr.y();
71 jvi["goal"][2] = pr.b();
72 jvi["goal"][3] = pr.e();
74 unsigned int icnt = 0;
75 unsigned int rcnt = 0;
76 unsigned int bcnt = 0;
77 Json::Value best_path;
85 if (pj["path"] != Json::nullValue) {
86 double gc = pj["goal_cc"].asDouble();
88 if (cost == 0.0 || gc < cost) {
89 best_path = pj["path"];
97 double elapsed = p.scnt();
100 for (auto p: ispath) {
101 jvo["ispath"][i][0] = p.x();
102 jvo["ispath"][i][1] = p.y();
103 jvo["ispath"][i][2] = p.h();
106 jvo["init"] = jvi["init"];
107 jvo["slot"] = jvi["slot"];
108 jvo["obst"] = jvi["obst"];
109 jvo["entry"] = jvi["goal"];
110 jvo["goal"][0] = ispath.back().x();
111 jvo["goal"][1] = ispath.back().y();
112 jvo["goal"][2] = ispath.back().h();
113 jvo["time"] = elapsed;
114 jvo["icnt"] = p.icnt();
117 jvo["path"] = best_path;
118 jvo["goal_cc"] = cost;
119 std::cout << jvo << std::endl;