Return Camera Actor frame as array of bytes efficiently

Hello, I am using ROS (Robot Operation System) with Unreal and I need to publish camera frames to ROS in order to simulate a camera sensor. I need to create a function that returns my camera actor frame as array of bytes whenever I call it. I found some stuff using Capture Component and the node “Read Render Target” but they are highly inefficient.