From f5d7eef43b24d1dd4ee3ba0e82b0a35270ae160f Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Mon, 6 Apr 2020 12:26:11 +0200 Subject: [PATCH 1/1] Fix possible goals for right parallel parking slot --- CHANGELOG.md | 3 +++ src/psp.cc | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b2bd19..dcd727c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ The format is based on [Keep a Changelog][] and this project adheres to ### Added - Workaround to not working `fe()` for perpendicular parking slot. +### Fixed +- Possible goals for right parallel parking slot. + ## 0.3.0 - 2020-02-04 ### Added - Guess goal car method. diff --git a/src/psp.cc b/src/psp.cc index 7fe4ea8..583bad2 100644 --- a/src/psp.cc +++ b/src/psp.cc @@ -207,12 +207,13 @@ std::vector PSPlanner::possible_goals( ) { std::vector pi; - if (this->cc().sp() > 0) + if (this->ps().parallel()) this->cc().sp(1); else this->cc().sp(-1); this->cc().sp(this->cc().sp() * dist); - this->cc().st(this->cc().st() * 1); + if (this->ps().right()) + this->cc().st(this->cc().st() * -1); BicycleCar orig_cc(this->cc()); for (unsigned int i = 0; i < cnt; i++) { this->cc().next(); -- 2.39.2