Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import rospy
- from std_msgs.msg import String
- def controller():
- pub = rospy.Publisher('motion_control', String, queue_size=10)
- rospy.init_node('controller')
- rate = rospy.Rate(10) #10Hz
- while not rospy.is_shutdown():
- data = raw_input("Command: ")
- #print(data)
- #hello_str = "Hello world"
- rospy.loginfo(data)
- pub.publish(data)
- rate.sleep()
- if __name__ == '__main__':
- try:
- controller()
- except rospy.ROSInterruptException:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement