]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Add arguments for find entry method
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Fri, 16 Jul 2021 10:02:28 +0000 (12:02 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Tue, 20 Jul 2021 14:49:17 +0000 (16:49 +0200)
Add bicycle car and maximum number of cusp car states as arguments for
find entry method.

incl/pslot.hh
src/pslot.cc

index c669d23e7e81d653bce5f18558bc373819a4aa6d..b7d3956cac05d7b9fa986a564ca37a2ddaaf11c8 100644 (file)
@@ -89,8 +89,12 @@ public:
         */
        std::vector<BicycleCar> drive_in_slot(BicycleCar c, unsigned int& max);
 
-       /*! Find entry. */
-       PoseRange fe();
+       /*! \brief Find entry.
+        *
+        * \param c For which `BicycleCar` should entry be found?
+        * \param max Maximum number of backward-forward direction changes.
+        */
+       PoseRange fe(BicycleCar c, unsigned int& max);
 
        friend std::ostream& operator<<(std::ostream& o, ParkingSlot const& s);
 };
index 9fdf4daa6e33339c58c9a67ad7fb56d3a22ffb26..5a4f1352d573feb288fb988c6d47f4cf89b710a9 100644 (file)
@@ -175,11 +175,10 @@ ParkingSlot::drive_in_slot(BicycleCar c, unsigned int& max)
 }
 
 PoseRange
-ParkingSlot::fe()
+ParkingSlot::fe(BicycleCar c, unsigned int& max)
 {
        assert(this->parallel());
        assert(this->right());
-       BicycleCar c;
        c.h(this->h());
        double clen = this->offset_ + this->len() - c.df();
        double cw = this->offset_ + c.w() / 2.0;
@@ -206,9 +205,8 @@ ParkingSlot::fe()
                starts.push_back(c);
        }
        std::vector<std::vector<BicycleCar>> entries;
-       unsigned int max_cusp = 10;
        for (auto s: starts) {
-               auto r = this->drive_in_slot(s, max_cusp);
+               auto r = this->drive_in_slot(s, max);
                if (r.size() > 0) {
                        entries.push_back(r);
                }