]> rtime.felk.cvut.cz Git - hubacji1/psp.git/blobdiff - api/psp.h
Update changelog
[hubacji1/psp.git] / api / psp.h
index b054c420cf65728f5419b96e094aec62e83df3b4..2520dcb2ea0875dd325b6b6122e50264c08999cc 100644 (file)
--- a/api/psp.h
+++ b/api/psp.h
@@ -43,6 +43,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 +60,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.
@@ -74,41 +95,4 @@ class PSPlanner {
                 PSPlanner();
 };
 
-/*! \brief Return intersection of two line segments.
-
-The output is tuple `std::tuple<bool, double, double>`, where the first
-value is true when there is an intersection and false otherwise. The
-second and third parameters in the return tuple are coordinates of the
-intersection.
-
-\see https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection
-
-\param x1 First line segment first `x` coordinate.
-\param y1 First line segment first `y` coordinate.
-\param x2 First line segment second `x` coordinate.
-\param y2 First line segment second `y` coordinate.
-\param x3 Second line segment first `x` coordinate.
-\param y3 Second line segment first `y` coordinate.
-\param x4 Second line segment second `x` coordinate.
-\param y4 Second line segment second `y` coordinate.
-*/
-std::tuple<bool, double, double> intersect(
-        double x1, double y1,
-        double x2, double y2,
-        double x3, double y3,
-        double x4, double y4
-);
-
-/*! \brief Is `x, y` coordinate in polynom `poly`?
-
-Return `true` if `x, y` coordinate is inside of polynom `poly`.
-
-\see https://en.wikipedia.org/wiki/Even%E2%80%93odd_rule
-
-\param x Horizontal coordinate.
-\param y Vertical coordinate.
-\param poly The vector of coordinates.
-*/
-bool inside(double x, double y, std::vector<std::tuple<double, double>> poly);
-
 #endif /* PSP_H */