]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blobdiff - incl/slotplanner.h
Add pose heading method to SlotPlanner
[hubacji1/iamcar.git] / incl / slotplanner.h
index 11dc5f1b940147f95e26ddb5df642e5e446ac77f..4fc77de942ce598ad606620aaa70762777822e32 100644 (file)
@@ -34,34 +34,38 @@ enum SlotType {
 };
 
 struct SamplingInfo {
+        float x0;
+        float y0;
+        float h0;
         float x;
         float y;
-        float r; // max radi from [x, y] for random sample
-        float mr; // minimum r added to random r
-        float h; // max angle for random sample
-        float mh; // max angle for heading of random sample
-        float mmh; // minimum mh added to mh
-        float sh; // slot heading
-        float dh; // direction to compute random heading from slot heading
+        float h;
 };
 
 class ParallelSlot {
         private:
                 float DH_ = 0.01;
                 std::vector<std::vector<RRTNode *>> cusp_;
+                std::vector<RRTNode *> goals_;
                 PolygonObstacle slot_;
+                float slotHeading_;
                 SlotSide slotSide_;
                 SlotType slotType_;
+                float poseHeading_;
         public:
                 ParallelSlot();
 
                 // getter
+                /** Get slot entry point */
+                std::vector<RRTNode *> &goals();
+                RRTNode *getMidd();
                 std::vector<std::vector<RRTNode *>> &cusp();
                 float DH() const;
                 PolygonObstacle &slot();
                 float slotHeading();
                 SlotSide slotSide();
                 SlotType slotType();
+                float poseHeading();
 
                 // setter
                 void DH(float dh);
@@ -69,7 +73,23 @@ class ParallelSlot {
 
                 // other
                 /** BFS to _Find Init Pose_. */
-                void fip();
+                void fip(
+                        std::vector<CircleObstacle>& co,
+                        std::vector<SegmentObstacle>& so
+                );
+                void fipf(
+                        std::vector<CircleObstacle>& co,
+                        std::vector<SegmentObstacle>& so
+                ); // perpendicular forward parking
+                /** _Find Last Not Colliding_ BicycleCar pose
+
+                @param B Find from?
+                */
+                BicycleCar *flnc(
+                        BicycleCar *B,
+                        std::vector<CircleObstacle>& co,
+                        std::vector<SegmentObstacle>& so
+                );
                 /** _Find Init Pose by Reverse_ approach, see Vorobieva2015
 
                 @param B Last pose of vehicle when it is parked.
@@ -81,11 +101,6 @@ class ParallelSlot {
                 @param B Find from?
                 */
                 BicycleCar *flncr(BicycleCar *B);
-                /** _Find Last Not Colliding_ BicycleCar pose
-
-                @param B Find from?
-                */
-                BicycleCar *flnc(BicycleCar *B);
                 RRTNode *fposecenter();
                 /** Recursive function to find out the moves */
                 bool flast(
@@ -102,6 +117,17 @@ class ParallelSlot {
                 BicycleCar *getEPC();
                 /** Return start pose for fipr method */
                 BicycleCar *getFP();
+                BicycleCar *getFPf(); // parked forward, only for perpendicular
+                /** In slot perpendicular pose getter
+
+                This method returns a pose of perpendicular parking slot from
+                where it is possible to get out of the slot with full steer to
+                farther corner side (i.e. right corner for the RIGHT side).
+
+                @param B The pose to start from.
+                */
+                BicycleCar *getISPP(BicycleCar *B);
+                BicycleCar *getISPPf(BicycleCar *B); // perp. forward parking
                 /** Return true if car is inside slot */
                 bool isInside(BicycleCar *c);
                 /** Return values to set sampling function of RRT */