From 7e9f4b4cef74c97ee2cf6af1656eb79ace776d4c Mon Sep 17 00:00:00 2001 From: sebplorenz Date: Thu, 11 May 2023 16:43:28 +0200 Subject: [PATCH] Added not None check for net-vector in turn decision, fixes #6467 --- PythonAPI/carla/agents/navigation/global_route_planner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PythonAPI/carla/agents/navigation/global_route_planner.py b/PythonAPI/carla/agents/navigation/global_route_planner.py index 7bc2a5a93bb..6d236e43cf4 100644 --- a/PythonAPI/carla/agents/navigation/global_route_planner.py +++ b/PythonAPI/carla/agents/navigation/global_route_planner.py @@ -360,7 +360,8 @@ def _turn_decision(self, index, route, threshold=math.radians(35)): if select_edge['type'] == RoadOption.LANEFOLLOW: if neighbor != route[index+1]: sv = select_edge['net_vector'] - cross_list.append(np.cross(cv, sv)[2]) + if sv is not None: + cross_list.append(np.cross(cv, sv)[2]) next_cross = np.cross(cv, nv)[2] deviation = math.acos(np.clip( np.dot(cv, nv)/(np.linalg.norm(cv)*np.linalg.norm(nv)), -1.0, 1.0))