*/
std::vector<BicycleCar> drive_in_slot(BicycleCar c, unsigned int& max);
+ /*! \brief Steer car `c` into the parking slot `this`.
+ *
+ * `steer_in_slot` returns the complete path as the list of `Pose`s, not
+ * just cusp `BicycleCar`s as `drive_to_slot`.
+ *
+ * \param c Starting bicycle car.
+ */
+ std::vector<Pose> steer_in_slot(BicycleCar c);
+
/*! \brief Find entry.
*
* \param c For which `BicycleCar` should entry be found?
return std::vector<BicycleCar>();
}
+std::vector<Pose>
+ParkingSlot::steer_in_slot(BicycleCar c)
+{
+ std::vector<Pose> path;
+ while (!this->parked(c)) {
+ path.push_back(c);
+ c.next();
+ if (this->collide(c)) {
+ c.sp(c.sp() * -1.0);
+ c.next();
+ c.st(c.st() * -1.0);
+ }
+ }
+ path.push_back(c);
+ return path;
+}
+
PoseRange
ParkingSlot::fe(BicycleCar c, unsigned int& max)
{