10 #define FORWARD_PARKING 0
12 /*! \brief Parking Slot Planner basic class.
14 \param cc Current bicycle car.
15 \param ps Parking slot.
24 unsigned int c_ = 0; // number of cusps
25 std::vector<BicycleCar> cusps_;
29 void fe_perpendicular();
30 // find entry to slot by reverse approach
32 void fer_perpendicular();
36 /*! \brief Return `true` if there is collision.
38 If the parking slot `ps` collide with current car `cc`,
41 This method depends on `intersection` function that
42 returns `true` or `false` if two line segments collide.
43 Each line segment of current car `cc` (borders) is
44 checked to each line segment of parking slot `ps`
48 /*! \brief Return parking direction
50 Return `true` if the direction of the parking in the
54 /*! \brief Guess goal car
56 Set the goal car guessed from the parking slot.
59 /*! \brief Return last maneuver to the parking slot.
61 Return path from entry point towards parking slot, such
62 that ``cc`` is inside the parking slot at the end.
64 std::vector<BicycleCar> last_maneuver();
65 /*! \brief Has current car `cc` left?
67 Return `true` if the current car `cc` left the parking
71 /*! \brief Is the goal car `gc` parked?
73 Return `true` if the goal car `gc` is inside the
77 /*! \brief Return possible starts of parking maneuver
79 When any `BicycleCar` of possible inits is reached, then
80 parking maneuver is a peace of cake.
82 \param cnt Number of inits.
83 \param dist Distance between inits.
85 std::vector<BicycleCar> possible_goals(
89 std::vector<BicycleCar> possible_goals()
91 return this->possible_goals(10, 0.5);
93 /*! \brief Shrink parking slot to perfect length.
95 Based on goal car dimensions, shrink `p1` and `p2`
96 towards the `p3` and `p4`. (Because backward parallel
99 NOTE: This function works for parallel parking only.
101 void shrink_to_perfect_len();
104 /*! \brief Find entry to the parking slot.
107 /*! \brief Find entry to slot by reverse approach.
109 See `Vorobieva2015` for more information.
114 BicycleCar &cc() { return this->cc_; }
115 BicycleCar &gc() { return this->gc_; }
116 ParkingSlot &ps() { return this->ps_; }
118 unsigned int c() const { return this->c_; }
119 std::vector<BicycleCar> &cusps() { return this->cusps_; }