]> rtime.felk.cvut.cz Git - hubacji1/psp.git/commitdiff
Add forward method skeleton, ut
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Mon, 22 Jul 2019 14:08:38 +0000 (16:08 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Mon, 22 Jul 2019 14:08:38 +0000 (16:08 +0200)
api/psp.h
ut/psp.t.cc

index e9813421d8f8ea7dcc6116124b11cc6abf13256e..57a0c07b2fe5d2e3f2a6caec5c664bd16fc0d5ab 100644 (file)
--- a/api/psp.h
+++ b/api/psp.h
@@ -34,6 +34,12 @@ class PSPlanner {
                 (parking slot lines).
                 */
                 bool collide();
+                /*! \brief Return parking direction
+
+                Return `true` if the direction of the parking in the
+                slot is forward.
+                */
+                bool forward();
                 /*! \brief Has current car `cc` left?
 
                 Return `true` if the current car `cc` left the parking
index f2b5e500276fe9bb8c40f4714751f07bba15f444..d1ea09467ce2c08e8fa5c75a9da2c1a70718c08a 100644 (file)
@@ -21,6 +21,7 @@ WVTEST_MAIN("parallel parking slot planner")
 
         // init orientation
         WVPASS(!psp.collide());
+        WVPASS(psp.forward());
         WVPASSEQ_DOUBLE(psp.ps().heading(), psp.gc().h(), 0.00001);
 
         // entry point found by reverse
@@ -63,6 +64,7 @@ WVTEST_MAIN("backward perpendicullar parking slot planner")
 
         // init orientation
         WVPASS(!psp.collide());
+        WVPASS(!psp.forward());
         WVPASSEQ_DOUBLE(psp.ps().heading() + M_PI / 2, psp.gc().h(), 0.00001);
 
         // entry point found by reverse
@@ -89,6 +91,7 @@ WVTEST_MAIN("forward perpendicullar parking slot planner")
 
         // init orientation
         WVPASS(!psp.collide());
+        WVPASS(psp.forward());
         WVPASSEQ_DOUBLE(psp.ps().heading() - M_PI / 2, psp.gc().h(), 0.00001);
 
         // entry point found by reverse