From 03a888a128ca11722465d30386641ddb084777f8 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Tue, 13 Aug 2019 13:51:44 +0200 Subject: [PATCH] Add guess goal car declaration, ut --- api/psp.h | 5 +++++ src/psp.cc | 4 ++++ ut/psp.t.cc | 8 ++------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/api/psp.h b/api/psp.h index 752811f..223e329 100644 --- 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 diff --git a/src/psp.cc b/src/psp.cc index 606c6f6..f43b9ef 100644 --- a/src/psp.cc +++ b/src/psp.cc @@ -33,6 +33,10 @@ bool PSPlanner::forward() return false; } +void PSPlanner::guess_gc() +{ +} + bool PSPlanner::left() { double lfx = this->cc().lfx(); diff --git a/ut/psp.t.cc b/ut/psp.t.cc index 36195b6..72aefa4 100644 --- a/ut/psp.t.cc +++ b/ut/psp.t.cc @@ -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 -- 2.39.2