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

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

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

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
4

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

gvdhoorn gravatar image

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

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

Comments

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 -0600 )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 -0600 )edit
2

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

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: http://answers.ros.org/question/46713... ....; Note that message loss (due to limited bandwidth or long running subscriber callbacks) is still possible.

edit flag offensive delete link more

Comments

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

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

Question Tools

1 follower

Stats

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

Seen: 456 times

Last updated: Dec 16 '14