From d5bb0b018baa3195e0d894a6e211153e6a93e6ca Mon Sep 17 00:00:00 2001 From: Markus Koschi Date: Wed, 6 Sep 2017 13:29:04 +0200 Subject: [PATCH] hotfix: bug in @Lanelet --- +world/@Lanelet/findLaneletByPosition.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/+world/@Lanelet/findLaneletByPosition.m b/+world/@Lanelet/findLaneletByPosition.m index 24bd68e..eaa80fd 100644 --- a/+world/@Lanelet/findLaneletByPosition.m +++ b/+world/@Lanelet/findLaneletByPosition.m @@ -17,7 +17,7 @@ function [lanelets] = findLaneletByPosition(obj, position) % Author: Markus Koschi % Written: 23-December-2016 -% Last update: 31-August-2017 +% Last update: 06-September-2017 % % Last revision:--- @@ -28,7 +28,7 @@ lanelets = world.Lanelet.empty(); for i = 1:numel(obj) % call inpolygon to check whether the position is in or on lanelet(i) xv = [obj(i).leftBorderVertices(1,:), fliplr(obj(i).rightBorderVertices(1,:)), obj(i).leftBorderVertices(1,1)]; - yv = [obj(i).leftBorderVertices(2,:), fliplr(obj(i).rightBorderVertices(2,:)), obj(1).leftBorderVertices(2,1)]; + yv = [obj(i).leftBorderVertices(2,:), fliplr(obj(i).rightBorderVertices(2,:)), obj(i).leftBorderVertices(2,1)]; [in, on] = inpolygon(position(1,:), position(2,:), xv, yv); if in || on lanelets(end+1) = obj(i); -- 2.22.0