From 680125f57dbea9223f0f8cf7f212c1da539d00e5 Mon Sep 17 00:00:00 2001 From: Hello Robot Inc Date: Thu, 30 Sep 2021 09:59:02 -0700 Subject: [PATCH] adding check for empty image --- stretch_funmap/src/stretch_funmap/navigation_planning.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stretch_funmap/src/stretch_funmap/navigation_planning.py b/stretch_funmap/src/stretch_funmap/navigation_planning.py index d7f49fa..acaa533 100644 --- a/stretch_funmap/src/stretch_funmap/navigation_planning.py +++ b/stretch_funmap/src/stretch_funmap/navigation_planning.py @@ -580,7 +580,9 @@ def draw_robot_footprint_rectangle(x_pix, y_pix, ang_rad, m_per_pix, image, verb poly_points = np.array(corners) poly_points = np.round(poly_points).astype(np.int32) - cv2.fillConvexPoly(image, poly_points, value) + + if image is not None: + cv2.fillConvexPoly(image, poly_points, value) def halve_image(image): h, w = image.shape