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; 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)