From 5f13bd817ece213ce13460523b2e5758cf6bc3f9 Mon Sep 17 00:00:00 2001 From: German Ros Date: Wed, 3 Apr 2019 15:09:02 -0700 Subject: [PATCH] Fix: Problem divided by small numbers in PythonAPI/navigation/misc.py Added eps --- PythonAPI/carla/agents/tools/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PythonAPI/carla/agents/tools/misc.py b/PythonAPI/carla/agents/tools/misc.py index 464fa8d26..4f2f8d338 100644 --- a/PythonAPI/carla/agents/tools/misc.py +++ b/PythonAPI/carla/agents/tools/misc.py @@ -103,6 +103,6 @@ def vector(location_1, location_2): x = location_2.x - location_1.x y = location_2.y - location_1.y z = location_2.z - location_1.z - norm = np.linalg.norm([x, y, z]) + norm = np.linalg.norm([x, y, z]) + np.finfo(float).eps return [x / norm, y / norm, z / norm]