From 435d3fb751369b5d053677f03d6efa1d66558763 Mon Sep 17 00:00:00 2001 From: Manav Gagvani Date: Mon, 1 Jul 2024 15:00:04 +0000 Subject: [PATCH] fixes addressing @Ezward review --- donkeycar/parts/lidar.py | 10 ++++++---- donkeycar/templates/complete.py | 9 --------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/donkeycar/parts/lidar.py b/donkeycar/parts/lidar.py index d86a35374..2136f91a4 100644 --- a/donkeycar/parts/lidar.py +++ b/donkeycar/parts/lidar.py @@ -737,10 +737,12 @@ def run(self, measurements): plot_polar_angle(draw, bounds, self.border_color, 0, self.angle_direction, self.rotate_plot) - # handle no data yet - if measurements is None: - print("bruh") - return np.asarray(self.frame) + # data points + if measurements: + plot_polar_points( + draw, bounds, self.mark_fn, self.point_color, self.mark_px, + [(distance, angle) for distance, angle, _, _, _ in measurements], + self.max_distance, self.angle_direction, self.rotate_plot) # data points plot_polar_points( diff --git a/donkeycar/templates/complete.py b/donkeycar/templates/complete.py index 7fc859496..3154d39cf 100644 --- a/donkeycar/templates/complete.py +++ b/donkeycar/templates/complete.py @@ -882,15 +882,6 @@ def add_camera(V, cfg, camera_type): 'imu/gyr_x', 'imu/gyr_y', 'imu/gyr_z'], threaded=False) - elif cfg.CAMERA_TYPE == "OAKD": - from donkeycar.parts.oak_d import OakD - cam = OakD( - enable_rgb=cfg.OAKD_RGB, - enable_depth=cfg.OAKD_DEPTH, - device_id=cfg.OAKD_ID) - V.add(cam, inputs=[], - outputs=['cam/image_array', 'cam/depth_array'], - threaded=True) elif cfg.CAMERA_TYPE == "LIDAR_PLOT": from donkeycar.parts.lidar import LidarPlot2