4 from robocup_knowledge
import knowledge_loader
7 common = knowledge_loader.load_knowledge(
"common")
10 O[P] -> ORDER[P] | can i have a ORDER[P] | i would like ORDER[P] | can i get ORDER[P] | could i have ORDER[P] | may i get ORDER[P] | bring me ORDER[P]
11 ORDER[<A1>] -> ITEMS[A1] | DET ITEMS[A1]
12 ORDER[<A1, A2>] -> ITEMS[A1] ITEMS[A2] | DET ITEMS[A1] DET ITEMS[A2] | DET ITEMS[A1] and DET ITEMS[A2] | ITEMS[A1] and ITEMS[A2]
13 ORDER[<A1, A2, A3>] -> ITEMS[A1] ITEMS[A2] ITEMS[A3] | ITEMS[A1] ITEMS[A2] and ITEMS[A3] |DET ITEMS[A1] DET ITEMS[A2] DET ITEMS[A3] | DET ITEMS[A1] and DET ITEMS[A2] and DET ITEMS[A3] | DET ITEMS[A1] DET ITEMS[A2] and DET ITEMS[A3]
28 candies = [
"biscuit",
"frosty_fruits",
"snakes"]
29 drinks = [
"beer",
"chocolate_milk",
"coke",
"juice",
"lemonade",
"water"]
30 food = [
"carrot",
"cereals",
"noodles",
"onion",
"vegemite"]
31 fruits = [
"apple",
"kiwi",
"lemon",
"orange",
"pear"]
32 snacks = [
"cheetos",
"doritos",
"shapes_chicken",
"shapes_pizza",
"twisties"]
41 for item
in candies + drinks + food + fruits + snacks:
42 order_grammar +=
"\nITEMS['{}'] -> {}[B]".format(item, item.replace(
'_',
' '))
44 if __name__ ==
"__main__":
46 from robot_skills.api
import Api
47 rospy.init_node(
'blaat')
49 rospy.sleep(rospy.Duration(0.5))
51 result = a.query(
"blaat", order_grammar,
"O")
52 import ipdb;ipdb.set_trace()