From 29648c70e15adc8fee060eec1fcbd6ac712df53e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 6 Nov 2025 12:25:30 +0000 Subject: [PATCH] Fix integer overflow warning in line intersection calculation Convert coordinates to float before arithmetic operations to prevent overflow when multiplying large integer coordinate values. Fixes RuntimeWarning: overflow encountered in scalar multiply --- fov_estimator_node.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fov_estimator_node.py b/fov_estimator_node.py index 8bbd9b4..3fb7e81 100644 --- a/fov_estimator_node.py +++ b/fov_estimator_node.py @@ -305,6 +305,10 @@ class FOVEstimatorNode: (x1, y1), (x2, y2) = line1 (x3, y3), (x4, y4) = line2 + # Convert to float to avoid integer overflow + x1, y1, x2, y2 = float(x1), float(y1), float(x2), float(y2) + x3, y3, x4, y4 = float(x3), float(y3), float(x4), float(y4) + denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4) if abs(denom) < 1e-6: # Lines are parallel