]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Make starts positions (of fe()) available
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Fri, 1 Apr 2022 14:43:13 +0000 (16:43 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Mon, 30 May 2022 14:08:42 +0000 (16:08 +0200)
incl/pslot.hh
src/pslot.cc

index 51fd7c83ee38dfefaeb307c22b3aabc2e23ea86e..19c1444013f98a9191adc8807d78a05395082500 100644 (file)
@@ -34,6 +34,7 @@ private:
 public:
        std::vector<std::vector<BicycleCar>> _ispaths;
        std::vector<BicycleCar> _entries;
+       std::vector<BicycleCar> _starts;
        /*! \brief Set parking slot.
 
        \param p Point with `x`, `y` coordinates of entry side's corner.
index d6593f2008ae2438f36aa55733231f0dcafe033d..3dd6c83f9e2364870ac077c77b903dad915ed63c 100644 (file)
@@ -376,14 +376,13 @@ ParkingSlot::fe(BicycleCar c)
        } else {
                max_to_slot = rr.min_angle_between(rc, i2);
        }
-       std::vector<BicycleCar> 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);