ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
So my question is which way is better when we compare it with data transmission.
Using semantically appropriate messages is always the "better" way.
Is your data structure a string? At the very least it's a dictionary, as you describe yourself. A dictionary != string.
Do not use strings to transmit data structures.
It's unnecessary and undesirable.
Which one will be faster and consume less memory?
Unless you have evidence already using a custom message (with proper fields) is causing you performance issues, do not prematurely optimise.