Closed MingshanHe closed 1 year ago
sensors_array_msg
in Bytes taking into account the allocated memory?I am using UART Totally 28 int numbers will be sent as array
Assuming BUFFER_SIZE = 28
:
sensors_array_msg.data.data
-> 28 * 8 B/int64 = 224 Bsensors_array_msg.layout.dim.data[i].label.data
-> 28 * STRING_SIZEAssuming STRING_SIZE, let's say 10 Bytes we have messages of 504 Bytes.
If you have a baud rate of 115200 bauds, this is approx 115 kbps = 14,3 kBps.
In a channel with 14,3 kBps, you will be able to send packages of 504 B at a rate of 14,3 kBps / 504 B = 28.5 Hz.
Probably you will not be able to reach 200 Hz using a serial port and this message size.
So what is the string size and string used in the multiarray publisher, is it like some fixed layout needed to send the topic message in ROS2? And How about using more UART ports to improve or other comments for improvement in my situation, like other ports?
The string used is ROS 2 type dependent, probably you will find more details about the type you are using in ROS 2 documentation.
In any case, you always can create your own type
Regarding the transport, probably a transport with a higher bandwidth would be a better solution if you need those rates with those message sizes.
Issue template
Expected behavior
I want to get the communication frequency over 200Hz, Thus I make the timer count number to be 5 (5ms per time). But it has not worked well as expected. How can I solve this problem?
Actual behavior
Additional information