March 2018
Intermediate to advanced
1396 pages
42h 14m
English
As we've already discussed, aiml_server is responsible for loading and saving the AIML and AIM brain files. It is subscribed to the /chatter topic, which is the input of the AIML interpreter and publishes the /response topic, which is the response from the AIML interpreter. This is the main code snippet of aiml_server.py:
def load_aiml(xml_file): data_path = rospy.get_param("aiml_path") print data_path os.chdir(data_path) if os.path.isfile("standard.brn"): mybot.bootstrap(brainFile = "standard.brn") else: mybot.bootstrap(learnFiles = xml_file, commands = "load aiml b") mybot.saveBrain("standard.brn") def callback(data): input = data.data response = mybot.respond(input) rospy.loginfo("I heard:: %s",data.data) rospy.loginfo("I ...