From 174cb7e59f87b3cd0500646901e636460210a7db Mon Sep 17 00:00:00 2001 From: fherrero <fherrero@iri.upc.edu> Date: Thu, 19 Jan 2023 17:22:59 +0100 Subject: [PATCH] Publish distance image despite detections size --- get_obj_dist/src/human_2d_to_3d.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/get_obj_dist/src/human_2d_to_3d.py b/get_obj_dist/src/human_2d_to_3d.py index c533f72..d251b08 100755 --- a/get_obj_dist/src/human_2d_to_3d.py +++ b/get_obj_dist/src/human_2d_to_3d.py @@ -101,9 +101,10 @@ class obj_dist: detections.header = depth.header #print('working lol') + cv_image = self.bridge.imgmsg_to_cv2(image, 'bgr8') if len(det2d.detections) > 0: cv_depth = self.bridge.imgmsg_to_cv2(depth, 'passthrough') - cv_image = self.bridge.imgmsg_to_cv2(image, 'bgr8') + #cv_image = self.bridge.imgmsg_to_cv2(image, 'bgr8') for i in range(0, 5): if i <= len(det2d.detections) - 1: @@ -123,6 +124,9 @@ class obj_dist: else: self.set_model_coordinates((-1, -1, -1), i) + + + self.image_pub.publish(self.bridge.cv2_to_imgmsg(cv_image)) self.marker_pub.publish(self.marker_array) self.detections_pub.publish(detections) @@ -173,7 +177,7 @@ class obj_dist: font_scale, font_color, line_type) - self.image_pub.publish(self.bridge.cv2_to_imgmsg(cv_image)) + #self.image_pub.publish(self.bridge.cv2_to_imgmsg(cv_image)) # TODO: Add dynamic find floor return x_meter, 0.0, current_avg -- GitLab