From f54f32c613d8b88f51d78ef7f7ccc66575f88bdd Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Thu, 20 Jan 2022 22:42:55 +0100 Subject: [PATCH] Update gen for gnuplot example code with entries --- src/gen_for_gnuplot.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gen_for_gnuplot.cc b/src/gen_for_gnuplot.cc index 491b42c..29731ad 100644 --- a/src/gen_for_gnuplot.cc +++ b/src/gen_for_gnuplot.cc @@ -65,7 +65,7 @@ public: }; void -gpl_slot(bcar::ParkingSlot& s, std::string fn) +gpl_slot(bcar::ParkingSlot& s, std::string fn = "") { if (fn.compare("") == 0) { return; @@ -85,13 +85,14 @@ gen_pl_script(std::vector& ms, std::string with_slot) f.open("plot.pl"); f << "#!/usr/bin/gnuplot" << endl; f << "set size ratio -1" << endl; - f << "plot"; + if (with_slot.compare("") != 0) { + f << "plot '" << with_slot << "' w l,"; + } else { + f << "plot"; + } for (auto& m: ms) { f << " '" << m.fn << "'" << " w l,"; } - if (with_slot.compare("") != 0) { - f << " '" << with_slot << "' w l"; - } f << endl; f << "pause -1" << endl; f.close(); @@ -109,6 +110,7 @@ main() gpl_slot(s, sn); s.fe(bcar::BicycleCar()); + s.compute_entries(); INIT_V P(RF_POINT) @@ -117,8 +119,7 @@ main() P(RR_POINT) for (auto& m: V) { - m.c = s._ispaths.front().front(); - m.c.sp(m.c.sp() * -1.0); + m.c = s._entries.front(); m.c.st(m.c.st() * -1.0); } for (unsigned int i = 0; i < STEPS; i++) { -- 2.39.2