Advertisement
130s

numpy_talker_with_rospy.loginfo

Nov 2nd, 2012
2,245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. def talker():
  2. topic = 'floats'
  3. pub = rospy.Publisher(topic, numpy_msg(Floats))
  4. rospy.init_node(topic, anonymous=True)
  5. r = rospy.Rate(10) # 10hz
  6. rospy.loginfo("I will publish to the topic %s", topic)
  7. while not rospy.is_shutdown():
  8. a = numpy.array([1.0, 2.1, 3.2, 4.3, 5.4, 6.5], dtype=numpy.float32)
  9. pub.publish(a)
  10. r.sleep()
  11.  
  12. if __name__ == '__main__':
  13. talker()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement