]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Store entries
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Mon, 29 Nov 2021 23:01:20 +0000 (00:01 +0100)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Mon, 29 Nov 2021 23:01:20 +0000 (00:01 +0100)
incl/pslot.hh
src/pslot.cc

index c8962cb2c5d3ff7f4c96c6c037da5c8433aa15f4..200acf3293cfcf1aa6e715673709aedd08a23776 100644 (file)
@@ -31,6 +31,7 @@ private:
        Line rear_;
        Line curb_;
        Line front_;
+       std::vector<std::vector<BicycleCar>> _entries;
 public:
        /*! \brief Set parking slot.
 
index 46a12a637cf0ca70d64307b8dd66bb3a24748536..85581fdcd923bc13abc3739dc63a6a805c2edd3c 100644 (file)
@@ -377,22 +377,21 @@ ParkingSlot::fe(BicycleCar c)
                c.rotate(rc, this->delta_angle_to_slot_);
                starts.push_back(c);
        }
-       std::vector<std::vector<BicycleCar>> 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();