ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You don't get any error messages about the turtlesim_node rejecting packages, do you? Also I don't understand why you differentiate between header and body in your question. After connection negotiation, you have socket that you keep open. The header is only transmitted when connecting. Then only messages are sent. First you have to transmit the length of the message as an int32 and then the serialized message itself.

Maybe you can be a little more specific and provide us a hexdump of what exactly you are sending over the socket?

You don't get any error messages about the turtlesim_node rejecting packages, do you? Also I don't understand why you differentiate between header and body in your question. After connection negotiation, you have socket that you keep open. The header is only transmitted when connecting. Then only messages are sent. First you have to transmit the length of the message as an int32 and then the serialized message itself.

Maybe you can be a little more specific and provide us a hexdump of what exactly you are sending over the socket?

Edit: Just to explain the data you sniffed with wireshark. You saw three 32bit numbers. The first one is an integer that indicates the number of bytes to follow, i.e. the payload is 8 bytes. Then the first 4 bytes are the float32 representation of the linear velocity and the next 4 bytes are the float32 representation of the angular velocity. If you send exactly that over a socket that you just created when the subscriber connects, you should be fine. But note when the subscriber connects you will receive a header containing the topic, md5 sum, caller id etc. The publisher then needs to send a header containing the type, caller id, the message definition, if the topic is latched and the md5 sum. After that, the publisher should be able to just send the serialized messages as you've seen on wireshark.