From 437541610fcd1fad66f4c4caf2ec8d34132322a9 Mon Sep 17 00:00:00 2001 From: donghaiwang Date: Sun, 1 Mar 2026 15:43:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[carla]=20Removed=20assert=20check=20making?= =?UTF-8?q?=20function=20unsafe=20=E4=B8=8D=E7=A7=BB=E9=99=A4=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E4=B8=AD=E7=94=B5=E8=BD=AF=E4=BB=B6=E5=9B=AD?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=B8=AD=E8=BF=90=E8=A1=8Cgenerate=5Ftraffic?= =?UTF-8?q?.py=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LibCarla/source/carla/geom/Vector3D.h | 1 - 1 file changed, 1 deletion(-) diff --git a/LibCarla/source/carla/geom/Vector3D.h b/LibCarla/source/carla/geom/Vector3D.h index f71bf59f1..6e99dd6fc 100644 --- a/LibCarla/source/carla/geom/Vector3D.h +++ b/LibCarla/source/carla/geom/Vector3D.h @@ -69,7 +69,6 @@ namespace geom { Vector3D MakeUnitVectorLengthInput(const double length, const float epsilon = 2.0f * std::numeric_limits::epsilon()) const { if (length < epsilon) { - DEVELOPMENT_ASSERT(length >= 2.0f * std::numeric_limits::epsilon()); return *this; } const double k = 1.0 / length; From d664210fa0f3bedb617aae7f5d87bebc99fefdb3 Mon Sep 17 00:00:00 2001 From: donghaiwang Date: Sun, 1 Mar 2026 15:44:28 +0800 Subject: [PATCH 2/2] [carla] Removed wrong tests --- PythonAPI/test/unit/test_geom.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/PythonAPI/test/unit/test_geom.py b/PythonAPI/test/unit/test_geom.py index f7723b0d6..4baf7694d 100644 --- a/PythonAPI/test/unit/test_geom.py +++ b/PythonAPI/test/unit/test_geom.py @@ -27,15 +27,6 @@ def test_vector3d(self): length = (c_unit.x ** 2 + c_unit.y ** 2 + c_unit.z ** 2) ** 0.5 self.assertAlmostEqual(length, 1.0) - # test the behavior of make_unit_vector when the length of the vector is smaller than epsilon - with self.assertRaisesRegex(RuntimeError, "length >= 2.0f"): - zero = carla.Vector3D(0.0, 0.0, 0.0) - zero_unit = zero.make_unit_vector() - - with self.assertRaisesRegex(RuntimeError, "length >= 2.0f"): - small = carla.Vector3D(1e-8, 0.0, 0.0) - small_unit = small.make_unit_vector(epsilon=1e-6) - large = carla.Vector3D(1e-4, 0.0, 0.0) large_unit = large.make_unit_vector(epsilon=1e-6) self.assertEqual(large_unit.x, 1.0)