0
$\begingroup$

Rosanswers logo

If I send a uint8[] array with 1 byte of data (of value 0x00) over ROSBridge, I receive the string "AA==" on the client end.

How does ROSbridge handle the conversion of byte arrays to strings? How can I retrieve my original data of 0x00?


Originally posted by trianta2 on ROS Answers with karma: 293 on 2013-12-23

Post score: 0


Original comments

Comment by mozcelikors on 2013-12-23:
I don't know how exactly rosbridge handles the data, but since the websockets are used, the memory spaces of payload and trailer are allocated. With websockets data is sent in between 0x00 and 0xFF in a packet. You can examine the rosbridge_library codes to see the conversion.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Apparently it's common for people to encode raw binary to Base64 before transmitting data via JSON objects. That's what was happening. I was able to decode the message from Base64 and retrieve my data.


Originally posted by trianta2 with karma: 293 on 2013-12-23

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.