Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Sequences numbers should be incremented on a publisher by publisher basis #151

Closed
chadrockey opened this issue Jan 3, 2013 · 5 comments
Closed

Comments

@chadrockey
Copy link
Contributor

Original author: chadrockey (November 22, 2012 07:59:41)

What steps will reproduce the problem?

  1. Create a node with more than one publisher.
  2. Start publishing messages on each publisher.
  3. Sequence numbers increment across publishes. rostopic echo topic/Header

What is the expected output? What do you see instead?
Sequence numbers are most useful on a topic by topic basis. Most users expect sequence numbers for each topic to increase 0, 1, 2, 3, 4, etc.

For slow publishing messages (I have one at 1Hz and another at 100Hz), I see the sequence numbers going from 3, to 104, to 205, to 302, etc. This means the sequence numbers are increasing for the node, not for each topic.

What version of the product are you using? On what operating system?
ROS Fuerte, Ubuntu 12.04, Rosjava 66a4b8c0be04

Please provide any additional information below.
The sequence number increase is static from this file:
http://code.google.com/p/rosjava/source/browse/rosjava_bootstrap/src/main/java/org/ros/internal/message/MessageProxyFactory.java

Original issue: http://code.google.com/p/rosjava/issues/detail?id=151

@damonkohler
Copy link
Member

There's nothing in the spec about how sequence numbers should behave other than that they should be increasing. Beyond that, if you were ever to miss a message on the subscriber, your assumption would still fail. I think it's a bad idea to depend on this.

@chadrockey
Copy link
Contributor Author

The best I could find is this page http://www.ros.org/wiki/Messages#Header :

"The seq field corresponds to an id that automatically increases as messages are sent from a given publisher."

@dirk-thomas @wjwwood Do you guys know what the right behavior for the sequence numbers are?

I guess specifically, I believe roscpp and rospy increment on a publisher basis, not a node basis, and we should try to be consistent. And while it's true that you can miss a sequence number if a message is dropped at the subscriber, some users use it to determine when a message is dropped, or as a convenient way to determine consecutive messages.

@chadrockey
Copy link
Contributor Author

Oh, and @tfoote can probably point us the right direction too.

@tfoote
Copy link

tfoote commented May 24, 2013

Josh's email here is the best I can find: https://code.ros.org/lurker/message/20091006.173235.9a6e4df1.en.html

@tfoote
Copy link

tfoote commented May 23, 2023

Note that this has been deprecated now: ros2/common_interfaces#1 (comment)

And removed in ROS 2: ros2/common_interfaces#2

@tfoote tfoote closed this as completed May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants