6 from rostopic
import get_topic_class
11 for msg, pub
in zip(msgs, pubs):
13 stamp = msg.header.stamp
15 msg.header.stamp = stamp
19 if __name__ ==
'__main__':
20 rospy.init_node(
'synchrnoze_republish')
21 topics = rospy.get_param(
'~topics')
22 use_async = rospy.get_param(
'~approximate_sync',
False)
25 for i, topic
in enumerate(topics):
26 topic = rospy.resolve_name(topic)
27 msg_class = get_topic_class(topic, blocking=
True)[0]
28 pub = rospy.Publisher(
29 '~pub_{0:0>2}'.format(i), msg_class, queue_size=1)
34 sync = message_filters.ApproximateTimeSynchronizer(
35 subs, queue_size=100, slop=0.1)
38 sync.registerCallback(callback)