SHARE
TWEET

numpy_talker_with_rospy.loginfo

130s Nov 2nd, 2012 668 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top