Ask Your Question

How to check whether message is the same as sent by the publisher?

asked 2014-12-15 23:39:23 -0500

Mind_hunter gravatar image

I want to check whether data send by the publisher is the same as received by the subscriber. So is this check already done by the ROS or i have to use CRC , checksum like methods within the messages to ensure that data is correct .

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-12-16 00:58:42 -0500

gvdhoorn gravatar image

updated 2014-12-16 02:15:10 -0500

If your publisher and subscriber are using TCPROS as the transport, then I'd say payload integrity is taken care of by the checksumming and retransmits inherent to TCP itself.

As to UDPROS, it uses UDP (..), which does have checksumming, but no reliability mechanisms (retransmitting corrupted datagrams fi). The checksum is also optional.

For any other transports (rosserial comes to mind), you'll have to investigate the included recovery mechanisms yourself (for rosserial, see rosserial/Overview/Protocol - Packet Format, which indicates there is a checksum included).

edit flag offensive delete link more


Thanks.I have to send the messages from raspberrypi to arduino through rosserial . How to access the checksum value from the packet. According to the link u have given above,does size of a packet of N byte message data is N+8 bytes

Mind_hunter gravatar image Mind_hunter  ( 2014-12-16 03:00:32 -0500 )edit

I don't know the details, but according to the screenshots in ROS Arduino message type restrictions? fi, rosserial already checks for corruptions. I think it then drops those packets.

gvdhoorn gravatar image gvdhoorn  ( 2014-12-16 03:45:36 -0500 )edit

answered 2014-12-16 01:19:02 -0500

Wolf gravatar image

In addition to what @gvdhoorn already stated I'd like to mention that if using TCPROS you can safely assume that messages received are transmitted correctly, unique (meaning for a single publish() the subscriber callback won't be called twice) and that for a single publisher/single subscriber connection you can safely assume that you will receive them in the same order as published; its stated here: ....; Note that message loss (due to limited bandwidth or long running subscriber callbacks) is still possible.

edit flag offensive delete link more


@Wolf: true, I'd forgotten to mention the application layer.

gvdhoorn gravatar image gvdhoorn  ( 2014-12-16 01:23:47 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-12-15 23:39:23 -0500

Seen: 279 times

Last updated: Dec 16 '14