From b27ac2b7560bcfbb33d81cdf26d127992fb4a431 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Tue, 30 Nov 2021 00:01:20 +0100 Subject: [PATCH] Store entries --- incl/pslot.hh | 1 + src/pslot.cc | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/incl/pslot.hh b/incl/pslot.hh index c8962cb..200acf3 100644 --- a/incl/pslot.hh +++ b/incl/pslot.hh @@ -31,6 +31,7 @@ private: Line rear_; Line curb_; Line front_; + std::vector> _entries; public: /*! \brief Set parking slot. diff --git a/src/pslot.cc b/src/pslot.cc index 46a12a6..85581fd 100644 --- a/src/pslot.cc +++ b/src/pslot.cc @@ -377,22 +377,21 @@ ParkingSlot::fe(BicycleCar c) c.rotate(rc, this->delta_angle_to_slot_); starts.push_back(c); } - std::vector> entries; for (auto s: starts) { auto r = this->drive_in_slot(s); if (r.size() > 0) { - entries.push_back(r); + this->_entries.push_back(r); } } - if (entries.size() == 0) { + if (this->_entries.size() == 0) { return PoseRange(Pose(0.0, 0.0, 0.0), Pose(0.0, 0.0, 0.0)); } - if (entries.size() == 1) { - auto f = entries.front().front(); + if (this->_entries.size() == 1) { + auto f = this->_entries.front().front(); return PoseRange(f, f); } - auto& c1 = entries.front().front(); - auto& c2 = entries.back().front(); + auto& c1 = this->_entries.front().front(); + auto& c2 = this->_entries.back().front(); PoseRange p(c1, c2); if (swapped) { this->swap_side(); -- 2.39.2