]> rtime.felk.cvut.cz Git - hubacji1/psp.git/blobdiff - api/psp.h
Use forward parking macro
[hubacji1/psp.git] / api / psp.h
index 91e0b9c07a35e3fe3ce638f71832298c45fdbbbd..2294a5b3f4175539062ebee59cd01b86ecc634f4 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.
@@ -19,6 +21,9 @@ class PSPlanner {
                 BicycleCar gc_;
                 ParkingSlot ps_;
 
+                unsigned int c_ = 0; // number of cusps
+                std::vector<BicycleCar> cusps_;
+
                 // find entry to slot
                 void fe_parallel();
                 void fe_perpendicular();
@@ -51,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
@@ -77,7 +88,7 @@ class PSPlanner {
                 );
                 std::vector<BicycleCar> possible_goals()
                 {
-                        return this->possible_goals(10, 1);
+                        return this->possible_goals(10, 0.5);
                 }
 
                 // find entry
@@ -95,6 +106,9 @@ class PSPlanner {
                 BicycleCar &gc() { return this->gc_; }
                 ParkingSlot &ps() { return this->ps_; }
 
+                unsigned int c() const { return this->c_; }
+                std::vector<BicycleCar> &cusps() { return this->cusps_; }
+
                 PSPlanner();
 };