From 7beeca8190f0896c51f4b2f8304f6c02930ce3c8 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Fri, 16 Jul 2021 12:02:28 +0200 Subject: [PATCH] Add arguments for find entry method Add bicycle car and maximum number of cusp car states as arguments for find entry method. --- incl/pslot.hh | 8 ++++++-- src/pslot.cc | 6 ++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/incl/pslot.hh b/incl/pslot.hh index c669d23..b7d3956 100644 --- a/incl/pslot.hh +++ b/incl/pslot.hh @@ -89,8 +89,12 @@ public: */ std::vector 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); }; diff --git a/src/pslot.cc b/src/pslot.cc index 9fdf4da..5a4f135 100644 --- a/src/pslot.cc +++ b/src/pslot.cc @@ -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> 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); } -- 2.39.2