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

Revision history [back]

click to hide/show revision 1
initial version

According to this implementation https://github.com/ros/ros_comm/blob/674263142a0be1124b273bdb1e0a79c3c956e259/clients/rospy/src/rospy/topics.py#L989, there are 2 things to note:

  1. If there is no connection established (meaning no subscriber exists), the sequence number remains 0 as default and no message is sent out
  2. If there is at least 1 connection, the sequence number is increased before any message is published, that is why the sequence number in the first msg is 1 instead of 0.

Anyway, according to this http://answers.ros.org/question/38856/ros-header-increasing-seq-in-service-calls/, it is not recommended to use header sequence for your logic.