]> rtime.felk.cvut.cz Git - hubacji1/psp.git/blobdiff - api/psp.h
Merge branch 'feature/refactor-bfs-parallel-parking-left-parking-slot'
[hubacji1/psp.git] / api / psp.h
index 0028fde0a827fce274b44c1319992d751410716e..70bbf79c42ee500131942f8e196f1e00ec6ad1e4 100644 (file)
--- a/api/psp.h
+++ b/api/psp.h
@@ -7,6 +7,8 @@
 #include "bcar.h"
 #include "pslot.h"
 
+#define FORWARD_PARKING 1
+
 /*! \brief Parking Slot Planner basic class.
 
 \param cc Current bicycle car.
@@ -20,6 +22,7 @@ class PSPlanner {
                 ParkingSlot ps_;
 
                 unsigned int c_ = 0; // number of cusps
+                std::vector<BicycleCar> cusps_;
 
                 // find entry to slot
                 void fe_parallel();
@@ -53,6 +56,12 @@ class PSPlanner {
                 Set the goal car guessed from the parking slot.
                 */
                 void guess_gc();
+                /*! \brief Return last maneuver to the parking slot.
+
+                Return path from entry point towards parking slot, such
+                that ``cc`` is inside the parking slot at the end.
+                */
+                std::vector<BicycleCar> last_maneuver();
                 /*! \brief Has current car `cc` left?
 
                 Return `true` if the current car `cc` left the parking
@@ -79,8 +88,17 @@ class PSPlanner {
                 );
                 std::vector<BicycleCar> possible_goals()
                 {
-                        return this->possible_goals(10, 1);
+                        return this->possible_goals(10, 0.5);
                 }
+                /*! \brief Shrink parking slot to perfect length.
+
+                Based on goal car dimensions, shrink `p1` and `p2`
+                towards the `p3` and `p4`. (Because backward parallel
+                parking).
+
+                NOTE: This function works for parallel parking only.
+                */
+                void shrink_to_perfect_len();
 
                 // find entry
                 /*! \brief Find entry to the parking slot.
@@ -98,6 +116,7 @@ class PSPlanner {
                 ParkingSlot &ps() { return this->ps_; }
 
                 unsigned int c() const { return this->c_; }
+                std::vector<BicycleCar> &cusps() { return this->cusps_; }
 
                 PSPlanner();
 };