]> rtime.felk.cvut.cz Git - hubacji1/psp.git/commitdiff
Add guess goal car declaration, ut
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Tue, 13 Aug 2019 11:51:44 +0000 (13:51 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Tue, 13 Aug 2019 13:07:23 +0000 (15:07 +0200)
api/psp.h
src/psp.cc
ut/psp.t.cc

index 752811fd97aa03b9690adda54f5de937b692faa1..223e32947b3ac2b154c294bab53ad7f2c13fa5cd 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
index 606c6f68441fa2f0b329c7a69c1aa0bd79dbad36..f43b9ef246ffd1770ab1cdd2d05a8fecc3640acf 100644 (file)
@@ -33,6 +33,10 @@ bool PSPlanner::forward()
                 return false;
 }
 
+void PSPlanner::guess_gc()
+{
+}
+
 bool PSPlanner::left()
 {
        double lfx = this->cc().lfx();
index 36195b6235e40c07c1a92cf2df5bbe147ec1ee11..72aefa49cca54978ad8ad22c73530c11bd231ccb 100644 (file)
@@ -7,9 +7,6 @@ WVTEST_MAIN("parallel parking slot planner")
 {
         PSPlanner psp;
         psp.ps().border(3, 3, 5, 3, 5, 8, 3, 8);
-        psp.gc().x(4);
-        psp.gc().y(4);
-        psp.gc().h(M_PI / 2);
         psp.gc().mtr(10);
         psp.gc().wb(2);
         psp.gc().w(1);
@@ -17,6 +14,7 @@ WVTEST_MAIN("parallel parking slot planner")
         psp.gc().he(1.5);
         psp.gc().df(2 + 0.5);
         psp.gc().dr(0.5);
+        psp.guess_gc();
         psp.cc() = BicycleCar(psp.gc());
 
         // init orientation
@@ -63,9 +61,6 @@ WVTEST_MAIN("backward perpendicullar parking slot planner")
 {
         PSPlanner psp;
         psp.ps().border(3, 3, 8, 3, 8, 5, 3, 5);
-        psp.gc().x(7);
-        psp.gc().y(4);
-        psp.gc().h(M_PI);
         psp.gc().mtr(10);
         psp.gc().wb(2);
         psp.gc().w(1);
@@ -73,6 +68,7 @@ WVTEST_MAIN("backward perpendicullar parking slot planner")
         psp.gc().he(1.5);
         psp.gc().df(2 + 0.5);
         psp.gc().dr(0.5);
+        psp.guess_gc();
         psp.cc() = BicycleCar(psp.gc());
 
         // init orientation