Skip to content

Commit

Permalink
Added is not None check for net vector in turn decision, fixes carla-…
Browse files Browse the repository at this point in the history
  • Loading branch information
sebplorenz committed May 11, 2023
1 parent f14acb2 commit 9e0304e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PythonAPI/carla/agents/navigation/global_route_planner.py
Expand Up @@ -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))
Expand Down

0 comments on commit 9e0304e

Please sign in to comment.