code-iai / ROSIntegration

Unreal Engine Plugin to enable ROS Support
MIT License
412 stars 133 forks source link

(UE5/Melodic) Subscribing to color compressedImage and depth Image at the same time #195

Closed tenfoldpaper closed 1 year ago

tenfoldpaper commented 1 year ago

Hi all, I've been trying to get my ROS program to subscribe to the RGB and D image from a Realsense 435. For color, I'm subscribing to compressedImage. For depth, I'm subscribing to Image, since it appears that ROSIntegration assumes a JPEG compression, whereas compressedDepth uses PNG compression.

Subscribing to only one of the topics at one time lets me grab the data without an issue. The problem arises when I try to get data from both topics at the same time.

The issue seems to be coming from how the bson data is being processed in the TCPConnection::ReceiverThreadFunction(). Specifically, the error in the cmd log is a mixture of these two lines: LogROS: Error: Error on BSON parse - Ignoring message LogROS: Error: BSON msg length is invalid.

This seems to put the ReceiverThreadFunction() in a permanent error while loop, so no other message gets processed.

Has anyone encountered this problem? I would like to avoid writing a fix on bson data processing since I would have to learn how the plugin processes the data from scratch.

Any help would be greatly appreciated!

tenfoldpaper commented 1 year ago

Seems like image subscription in general is broken. Received data in bytes for both compressed and raw image is 8. I will instead find a workaround solution for this problem.