From 94d9eef2caf5891e7fd48497ff2c612ec8a99152 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Mon, 22 Jul 2019 16:08:38 +0200 Subject: [PATCH] Add forward method skeleton, ut --- api/psp.h | 6 ++++++ ut/psp.t.cc | 3 +++ 2 files changed, 9 insertions(+) diff --git a/api/psp.h b/api/psp.h index e981342..57a0c07 100644 --- 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 diff --git a/ut/psp.t.cc b/ut/psp.t.cc index f2b5e50..d1ea094 100644 --- a/ut/psp.t.cc +++ b/ut/psp.t.cc @@ -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 -- 2.39.2