11 /*! \brief Parking slot basic class.
13 * This class contains some geometrical computations of parking slot. Parking
14 * slot consists of 4 cartesian coordinates `border` representing the border of
19 double offset_ = 0.001; // to avoid collision during init
26 /*! \brief Set parking slot.
28 \param p Point with `x`, `y` coordinates of entry side's corner.
29 \param h Direction of the entry side.
30 \param W The width of the slot.
31 \param L The length of the slot.
33 ParkingSlot(Point p, double h, double W, double L);
34 ParkingSlot(double lrx, double lry, double rrx, double rry, double rfx,
35 double rfy, double lfx, double lfy);
37 /*! Get slot's length. */
40 /*! Get slot's width. */
43 /*! Get slot's left front x coordinate. */
46 /*! Get slot's left front y coordinate. */
49 /*! Get slot's left rear x coordinate. */
52 /*! Get slot's left rear y coordinate. */
55 /*! Get slot's right rear x coordinate. */
58 /*! Get slot's right rear y coordinate. */
61 /*! Get slot's right front x coordinate. */
64 /*! Get slot's right front y coordinate. */
67 /*! Return parking slot's orientation. */
70 /*! Return `true` for the parallel parking slot. */
71 bool parallel() const;
73 /*! Return `true` for the parking slot on the right side. */
76 /*! Change side of the parking slot. */
79 /*! Return `true` if car `c` is parking in slot `this`. */
80 bool parked(BicycleCar const& c) const;
82 /*! Return `true` if `c`'s car frame collide with `this` border. */
83 bool collide(BicycleCar const& c) const;
85 /*! \brief Drive car `c` into the parking slot `this`.
87 * \param c Starting bicycle car.
88 * \param max Maximum number of backward-forward direction changes.
90 std::vector<BicycleCar> drive_in_slot(BicycleCar c, unsigned int& max);
92 /*! \brief Steer car `c` into the parking slot `this`.
94 * `steer_in_slot` returns the complete path as the list of `Pose`s, not
95 * just cusp `BicycleCar`s as `drive_to_slot`.
97 * \param c Starting bicycle car.
99 std::vector<Pose> steer_in_slot(BicycleCar c);
101 /*! \brief Find entry.
103 * \param c For which `BicycleCar` should entry be found?
104 * \param max Maximum number of backward-forward direction changes.
106 PoseRange fe(BicycleCar c, unsigned int& max);
108 /*! \brief Recompute zero slot's `PoseRange` entry for `this`.
110 * The _zero_ slot is the `ParkingSlot(Point(0.0, 0.0), 0.0, W, L);`.
112 * \param p Computed `PoseRange` entry.
114 PoseRange recompute_entry(PoseRange p);
116 friend std::ostream& operator<<(std::ostream& o, ParkingSlot const& s);
120 #endif /* BCAR_PSLOT_H */