]> 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 f10b7def354653ce59f983d1fa2f26ab68ab3f89..4fc77de942ce598ad606620aaa70762777822e32 100644 (file)
@@ -34,30 +34,30 @@ 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;
@@ -65,6 +65,7 @@ class ParallelSlot {
                 float slotHeading();
                 SlotSide slotSide();
                 SlotType slotType();
+                float poseHeading();
 
                 // setter
                 void DH(float dh);
@@ -76,6 +77,10 @@ class ParallelSlot {
                         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?
@@ -112,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 */