From 2b249b501c55e34deef00bdce85a5e875db0fbc0 Mon Sep 17 00:00:00 2001 From: Pablo Villanueva-Domingo Date: Tue, 8 Oct 2024 16:54:33 +0200 Subject: [PATCH] Fix DVS sensor bug in manual control due to np.bool deprecation in newer numpy version (#8256) * Update numpy version compatible for Python 3.8-3.11 * Update comments for generations of vehicles and pedestrians * Update generation comments in all scripts which include the filter * Update filter and printed message in vehicle_physics.py * Add vertical offset to avoid collision when spawning * Fix DVS sensor bug in manual control due to np.bool deprecation --- PythonAPI/examples/manual_control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PythonAPI/examples/manual_control.py b/PythonAPI/examples/manual_control.py index bd6b6b6a1..f7b7aabd0 100755 --- a/PythonAPI/examples/manual_control.py +++ b/PythonAPI/examples/manual_control.py @@ -1194,7 +1194,7 @@ class CameraManager(object): # Example of converting the raw_data from a carla.DVSEventArray # sensor into a NumPy array and using it as an image dvs_events = np.frombuffer(image.raw_data, dtype=np.dtype([ - ('x', np.uint16), ('y', np.uint16), ('t', np.int64), ('pol', np.bool)])) + ('x', np.uint16), ('y', np.uint16), ('t', np.int64), ('pol', np.bool_)])) dvs_img = np.zeros((image.height, image.width, 3), dtype=np.uint8) # Blue is positive, red is negative dvs_img[dvs_events[:]['y'], dvs_events[:]['x'], dvs_events[:]['pol'] * 2] = 255