March 2018
Intermediate to advanced
1396 pages
42h 14m
English
The client code will wait for user input and publish the user input to the /chatter topic:
#!/usr/bin/env python
import rospy
from std_msgs.msg import String
pub = rospy.Publisher('chatter', String,queue_size=10)
rospy.init_node('aiml_client')
r = rospy.Rate(1) # 10hz
while not rospy.is_shutdown():
input = raw_input("\nEnter your text :> ")
pub.publish(input)
r.sleep()