Closed jim18324 closed 3 years ago
I never experienced this error in any of my projects but I presume the serialization on the Unity side or the deserailization on ros2-web-bridge is the problem. I'd suggest you check the length of the byte[] that leaves Unity (e.g. in RosSocket Line 173 or in the actual protocol or serializer that you are using).
The image data is at no point artificially extendend, see CompressedImage and ImagePublisher.
[x] I am at the right place and my issue is directly related to ROS#. General technical questions I would post e.g. at ROS Answers or Stack Overflow. For library-specific questions I would look for help in the corresponding library forums.
[x] I have thoroughly read the Contributing Guideline and writing this issue is the right thing to do in my case.
I have a question!
Here is my question:
Hi, I'm very new to ROS and Unity. I'm trying to send the raw image/compressed image data from Unity to ROS2 by ros2-web-bridge.
During my experiments, I found out that the image data length increased before passing to ros2-web-bridge. This increment follow an order of dived by 3 and multiply by 4. So if my image size is 100*100 pixels with RGB24 texture format, in theory i will received a byte array with length 300 in the ROS2 side. But in reality, i received a byte array with length 400. This issue happens in default compressed image publisher and raw image publisher. However, if i change byte array to uint array, it work fine. Can you please help me figure this out? The video is the record of the problem that i encountered. https://youtu.be/SzQc338rtjQ