diff --git a/simulation/ai-polygon/mounted_sensors.py b/simulation/ai-polygon/mounted_sensors.py index 20b921a6..946b36a9 100644 --- a/simulation/ai-polygon/mounted_sensors.py +++ b/simulation/ai-polygon/mounted_sensors.py @@ -296,7 +296,10 @@ def mounted_range_returns(query, origin, directions, key, spec, forward, *, str(hit.get("rigidBody", "")).startswith("/World/Rover") or str(hit.get("collision", "")).startswith("/World/Rover") ): - positions[row] = hit["position"] + point = hit["position"] + # NumPy probes arbitrary sequence protocols on pybind Float3, + # which is much slower than reading its three exact components. + positions[row] = (point[0], point[1], point[2]) paths[row] = str(hit.get("collision", "")) distances = np.linalg.norm(positions - origin, axis=1) depth = np.full(count, np.nan, np.float32)