Created
December 10, 2019 13:07
-
-
Save xaedes/629d048b9501b63dfe8a7c2f4c20e8fb to your computer and use it in GitHub Desktop.
Publish ROS message with seq number as specified in message in Python / Rospy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pub(publisher, msg): | |
# undocumented rospy behaviour: | |
# publisher.publish will pre-inc publisher.impl.seq | |
# and use this instead of msg.header.seq | |
# (see https://github.com/ros/ros_comm/blob/309753f4777755f1dc9482f26fbeeeceb48f352d/clients/rospy/src/rospy/topics.py#L1065) | |
publisher.impl.seq = msg.header.seq - 1 | |
publisher.publish(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment