From dc0b229ac895a4654720f366f2d4576b8cff7d3f Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Fri, 1 Apr 2022 16:43:13 +0200 Subject: [PATCH] Make starts positions (of fe()) available --- incl/pslot.hh | 1 + src/pslot.cc | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/incl/pslot.hh b/incl/pslot.hh index 51fd7c8..19c1444 100644 --- a/incl/pslot.hh +++ b/incl/pslot.hh @@ -34,6 +34,7 @@ private: public: std::vector> _ispaths; std::vector _entries; + std::vector _starts; /*! \brief Set parking slot. \param p Point with `x`, `y` coordinates of entry side's corner. diff --git a/src/pslot.cc b/src/pslot.cc index d6593f2..3dd6c83 100644 --- a/src/pslot.cc +++ b/src/pslot.cc @@ -376,14 +376,13 @@ ParkingSlot::fe(BicycleCar c) } else { max_to_slot = rr.min_angle_between(rc, i2); } - std::vector starts; double a_to_slot = 0.0; while (a_to_slot < max_to_slot) { a_to_slot += this->_delta_angle_to_slot; c.rotate(rc, this->_delta_angle_to_slot); - starts.push_back(c); + this->_starts.push_back(c); } - for (auto s: starts) { + for (auto s: this->_starts) { auto r = this->drive_in_slot(s); if (r.size() > 0) { this->_ispaths.push_back(r); -- 2.39.2