Ruslan_nig

ros_BlinkTestMy_python

Jun 18th, 2021
843
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2.  
  3. import rospy
  4. from std_msgs.msg import Int8
  5.  
  6. def talker():
  7.     pub = rospy.Publisher('chatter', Int8, queue_size=10)
  8.     rospy.init_node('talker', anonymous=True)
  9.     rate = rospy.Rate(1) # 10hz
  10.     while not rospy.is_shutdown():
  11.         hello_str = 4
  12.         rospy.loginfo(hello_str)
  13.     pub.publish(hello_str)
  14.         rate.sleep()
  15.  
  16. if __name__ == '__main__':
  17.     try:
  18.         talker()
  19.     except rospy.ROSInterruptException:
  20.         pass
RAW Paste Data