From ba0c730bd78c179cc1c61d2812bbb58f2b3f7df3 Mon Sep 17 00:00:00 2001 From: "nikolaus.feith" Date: Thu, 2 Mar 2023 15:20:56 +0100 Subject: [PATCH] Image data is not correct --- src/active_bo_msgs/msg/ImageFeedback.msg | 6 +++--- src/active_bo_ros/active_bo_ros/rl_service.py | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/active_bo_msgs/msg/ImageFeedback.msg b/src/active_bo_msgs/msg/ImageFeedback.msg index 1c6a82a..cc8ad92 100644 --- a/src/active_bo_msgs/msg/ImageFeedback.msg +++ b/src/active_bo_msgs/msg/ImageFeedback.msg @@ -1,5 +1,5 @@ int16 height int16 width -uint8[] red -uint8[] green -uint8[] blue \ No newline at end of file +uint16[] red +uint16[] green +uint16[] blue \ No newline at end of file diff --git a/src/active_bo_ros/active_bo_ros/rl_service.py b/src/active_bo_ros/active_bo_ros/rl_service.py index 6f95527..bf6d7b8 100644 --- a/src/active_bo_ros/active_bo_ros/rl_service.py +++ b/src/active_bo_ros/active_bo_ros/rl_service.py @@ -40,8 +40,15 @@ class RLService(Node): rgb_array = output[5] rgb_shape = rgb_array.shape + red = rgb_array[:, :, 0].flatten().tolist() + green = rgb_array[:, :, 1].flatten().tolist() + blue = rgb_array[:, :, 2].flatten().tolist() + feedback_msg.height = rgb_shape[0] feedback_msg.width = rgb_shape[1] + feedback_msg.red = red + feedback_msg.green = green + feedback_msg.blue = blue self.publisher.publish(feedback_msg)