]> rtime.felk.cvut.cz Git - hubacji1/psp.git/blobdiff - api/psp.h
Add set goal car position method
[hubacji1/psp.git] / api / psp.h
index 752811fd97aa03b9690adda54f5de937b692faa1..4c71d3e455ab53adc142526ba25c6ef9508a3d0f 100644 (file)
--- a/api/psp.h
+++ b/api/psp.h
@@ -19,11 +19,14 @@ class PSPlanner {
                 BicycleCar gc_;
                 ParkingSlot ps_;
 
-                // find entry to slot by reverse approach
+                // find entry to slot
                 void fe_parallel();
                 void fe_perpendicular();
+                // find entry to slot by reverse approach
                 void fer_parallel();
                 void fer_perpendicular();
+                // set goal car
+                void gc_to_4();
         public:
                 /*! \brief Return `true` if there is collision.
 
@@ -43,6 +46,11 @@ class PSPlanner {
                 slot is forward.
                 */
                 bool forward();
+                /*! \brief Guess goal car
+
+                Set the goal car guessed from the parking slot.
+                */
+                void guess_gc();
                 /*! \brief Has current car `cc` left?
 
                 Return `true` if the current car `cc` left the parking
@@ -55,6 +63,22 @@ class PSPlanner {
                 parking slot `ps`.
                 */
                 bool parked();
+                /*! \brief Return possible starts of parking maneuver
+
+                When any `BicycleCar` of possible inits is reached, then
+                parking maneuver is a peace of cake.
+
+                \param cnt Number of inits.
+                \param dist Distance between inits.
+                */
+                std::vector<BicycleCar> possible_inits(
+                        unsigned int cnt,
+                        double dist
+                );
+                std::vector<BicycleCar> possible_inits()
+                {
+                        return this->possible_inits(10, 1);
+                }
 
                 // find entry
                 /*! \brief Find entry to the parking slot.