Merge branch 'main' of https://github.com/HPCL-EI/RoboWaiter
This commit is contained in:
commit
c5e54c6cae
|
@ -0,0 +1,6 @@
|
|||
# 安装环境
|
||||
```python
|
||||
pip3 install torch torchvision torchaudio
|
||||
conda install -c conda-forge faiss
|
||||
pip install src
|
||||
```
|
|
@ -0,0 +1,41 @@
|
|||
{"id": 0, "title": "你好", "text": "{'answer': '您好,我是这家咖啡厅的服务员,请问您要点什么?', 'function': None}"}
|
||||
{"id": 1, "title": "感谢,这些够啦,你去忙吧。", "text": "{'answer': 'ok, 有需要您再找我。', 'function': None}"}
|
||||
{"id": 2, "title": "做一杯咖啡", "text": "{'answer': '好的,我马上做咖啡', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Coffee,CoffeeTable)\"}'}"}
|
||||
{"id": 3, "title": "不用了。", "text": "{'answer': '好的,您有需要再跟我说', 'function': 'stop_serve', 'args': '{}'}"}
|
||||
{"id": 4, "title": "来一号桌", "text": "{'answer': '好的,我马上来一号桌', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,Table1)\"}'}"}
|
||||
{"id": 5, "title": "早上好呀,我想找个能晒太阳的地方。", "text": "{'answer': '您右手边就有能晒太阳的位置呢。', 'function': None}"}
|
||||
{"id": 6, "title": "可以带我过去嘛?", "text": "{'answer': '当然,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable1)\"}'}"}
|
||||
{"id": 7, "title": "嘿,RoboWaiter,过来一下!", "text": "{'answer': '我在来的路上啦,请稍等噢!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable6)\"}'}"}
|
||||
{"id": 8, "title": "你们这有什么饮料嘛?", "text": "{'answer': '我们咖啡厅提供各种口味咖啡,水,冰红茶,酸奶等饮品,还提供点心蛋糕等甜品。您想点什么?', 'function': None}"}
|
||||
{"id": 9, "title": "来杯卡布奇诺吧。", "text": "{'answer': 'ok,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Coffee,BrightTable6)\"}'}"}
|
||||
{"id": 10, "title": "我昨天保温杯好像落在你们咖啡厅了,你看到了吗?", "text": "{'answer': '是的,我有印象,保温杯在大厅的2号桌子上。', 'function': 'get_object_info', 'args': '{\"obj\":\"保温杯\"}'}"}
|
||||
{"id": 11, "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}"}
|
||||
{"id": 12, "title": "打包吧,快点!", "text": "{'answer': '请稍等,马上就好!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Dessert,Bar),On(Coffee,Bar)\"}'}"}
|
||||
{"id": 13, "title": "你可以帮我拿来吗,我在前门的桌子前等你。", "text": "{'answer': '当然,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(VacuumCup,Table1)\"}'}"}
|
||||
{"id": 14, "title": "麻烦啦!", "text": "{'answer': '没事儿,为您服务是我的荣幸!', 'function': None}"}
|
||||
{"id": 15, "title": "大厅的桌子好啊,快带我去呀!", "text": "{'answer': '好的好的,请跟我来。', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,WaterTable)\"}'}"}
|
||||
{"id": 16, "title": "我想来杯水,帮我孩子拿个酸奶吧。", "text": "{'answer': 'ok,没问题,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Water,WaterTable),On(Yogurt,WaterTable)\"}'}"}
|
||||
{"id": 17, "title": "来杯酸奶吧。", "text": "{'answer': '好的没问题,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,WaterTable)\"}'}"}
|
||||
{"id": 18, "title": "好热呀!太阳也好大!", "text": "{'answer': '抱歉,我这就去开空调和关窗帘。', 'function': 'create_sub_task', 'args': '{\"goal\":\"Is(AC,On),Is(Curtain,Off)\"}'}"}
|
||||
{"id": 19, "title": "下班啦!别忘了打扫卫生。", "text": "{'answer': '收到!下班啦!', 'function': 'create_sub_task', 'args': '{\"goal\":\"Is(Floor,Clean),Is(Table1,Clean),Is(Chairs,Clean),Is(AC,Off),Is(HallLight,Off),Is(TubeLight,Off),Is(Curtain,Off)\"}'}"}
|
||||
{"id": 20, "title": "请问洗手间在哪里?", "text": "{'answer': '洗手间在这附近', 'function': 'get_object_info', 'args': '{\"obj\":\"洗手间\"}'}"}
|
||||
{"id": 21, "title": "给我来杯酸奶和冰红茶,我坐在对面的桌子那儿。", "text": "{'answer': '好的,请稍等。', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Chips,WaterTable),On(NFCJuice,WaterTable)\"}'}"}
|
||||
{"id": 22, "title": "给我来份薯片和果汁,我坐在对面的桌子那儿。", "text": "{'answer': '好的,请稍等。', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(BottledDrink,WaterTable),On(Yogurt,WaterTable)\"}'}"}
|
||||
{"id": 23, "title": "好热呀,想开空调,想要温度调低点!", "text": "{'answer': '抱歉,我马上去开空调并调低空调温度。', 'function': 'create_sub_task', 'args': '{\"goal\":\"Is(ACTemperature,Down)\"}'}"}
|
||||
{"id": 24, "title": "请问哪里有空位啊?", "text": "{'answer': '现在有不少空位呢,请问您有什么要求嘛?', 'function': None}"}
|
||||
{"id": 25, "title": "我想坐高脚凳子。", "text": "{'answer': '没问题,大厅里就有这样的位置呢!', 'function': None}"}
|
||||
{"id": 26, "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}"}
|
||||
{"id": 27, "title": "可以关筒灯和关窗帘吗?", "text": "{'answer': '好的,请稍等。', 'function': 'create_sub_task', 'args': '{\"goal\":\"Is(TubeLight,Off),Is(Curtain,Off)\"}'}"}
|
||||
{"id": 28, "title": "给我来杯咖啡,哦对,再倒一杯水。", "text": "{'answer': '速速就好,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Water,WaterTable),On(Coffee,WaterTable)\"}'}"}
|
||||
{"id": 29, "title": "我想来份点心和酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar),On(Dessert,Bar)\"}'}"}
|
||||
{"id": 30, "title": "酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar)\"}'}"}
|
||||
{"id": 31, "title": "你好呀,你们这有啥好吃的?", "text": "{'answer': '我们咖啡厅有咖啡,还有饮料和点心蛋糕呢?您想点什么不?', 'function': None}"}
|
||||
{"id": 32, "title": "听起来都好甜呀,我女朋友爱吃水果。", "text": "{'answer': '没问题,我们也提供草莓、橘子和苹果等水果呢。', 'function': None}"}
|
||||
{"id": 33, "title": "你们这人可真多。", "text": "{'answer': '目前还有空位呢,你们可以坐下来一起品尝水果呢?', 'function': 'get_object_info', 'args': '{\"obj\":\"空位\"}'}"}
|
||||
{"id": 34, "title": "我女朋友怕晒,有空余的阴凉位置嘛?", "text": "{'answer': '我查询完毕,阴凉位置有两个。在你们右侧往里走,就有适合你们二位的沙发呢。', 'function': 'get_object_info', 'args': '{\"obj\":\"阴凉空位\"}'}"}
|
||||
{"id": 35, "title": "那还不错。", "text": "{'answer': '是的,那边安静,不会晒到太阳呢。', 'function': None}"}
|
||||
{"id": 36, "title": "我们还想一起下下棋,切磋切磋。", "text": "{'answer': '我们这有两份军棋呢,在大厅的三号桌上。', 'function': 'get_object_info', 'args': '{\"obj\":\"棋\"}'}"}
|
||||
{"id": 37, "title": "请问洗手间在哪呢?", "text": "{'answer': '在后门,你们的左侧往里走就是了呢。', 'function': 'get_object_info', 'args': '{\"obj\":\"洗手间\"}'}"}
|
||||
{"id": 38, "title": "我带着孩子呢,想要宽敞亮堂的地方。", "text": "{'answer': '好的,我明白了,那么我们推荐您到大厅的桌子,那里的空间比较宽敞,环境也比较明亮,适合带着孩子一起用餐。', 'function': None}"}
|
||||
{"id": 39, "title": "冰红茶", "text": "{'answer': '好的', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Softdrink,Bar)\"}'}"}
|
||||
{"id": 40, "title": "水杯", "text": "{'answer': '好的', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Glass,Bar)\"}'}"}
|
|
@ -0,0 +1,240 @@
|
|||
你好
|
||||
您好,我是这家咖啡厅的服务员,请问您要点什么?
|
||||
|
||||
|
||||
感谢,这些够啦,你去忙吧。
|
||||
ok, 有需要您再找我。
|
||||
|
||||
|
||||
做一杯咖啡
|
||||
好的,我马上做咖啡
|
||||
create_sub_task
|
||||
{"goal":"On(Coffee,CoffeeTable)"}
|
||||
|
||||
不用了。
|
||||
好的,您有需要再跟我说
|
||||
stop_serve
|
||||
{}
|
||||
|
||||
来一号桌
|
||||
好的,我马上来一号桌
|
||||
create_sub_task
|
||||
{"goal":"At(Robot,Table1)"}
|
||||
|
||||
|
||||
早上好呀,我想找个能晒太阳的地方。
|
||||
您右手边就有能晒太阳的位置呢。
|
||||
|
||||
|
||||
可以带我过去嘛?
|
||||
当然,请跟我来!
|
||||
create_sub_task
|
||||
{"goal":"At(Robot,BrightTable1)"}
|
||||
|
||||
|
||||
嘿,RoboWaiter,过来一下!
|
||||
我在来的路上啦,请稍等噢!
|
||||
create_sub_task
|
||||
{"goal":"At(Robot,BrightTable6)"}
|
||||
|
||||
|
||||
你们这有什么饮料嘛?
|
||||
我们咖啡厅提供各种口味咖啡,水,冰红茶,酸奶等饮品,还提供点心蛋糕等甜品。您想点什么?
|
||||
|
||||
|
||||
来杯卡布奇诺吧。
|
||||
ok,请稍等!
|
||||
create_sub_task
|
||||
{"goal":"On(Coffee,BrightTable6)"}
|
||||
|
||||
|
||||
|
||||
|
||||
我昨天保温杯好像落在你们咖啡厅了,你看到了吗?
|
||||
是的,我有印象,保温杯在大厅的2号桌子上。
|
||||
get_object_info
|
||||
{"obj":"保温杯"}
|
||||
|
||||
|
||||
给我来份午餐套餐。
|
||||
本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?
|
||||
|
||||
打包吧,快点!
|
||||
请稍等,马上就好!
|
||||
create_sub_task
|
||||
{"goal":"On(Dessert,Bar),On(Coffee,Bar)"}
|
||||
|
||||
|
||||
你可以帮我拿来吗,我在前门的桌子前等你。
|
||||
当然,请稍等!
|
||||
create_sub_task
|
||||
{"goal":"On(VacuumCup,Table1)"}
|
||||
|
||||
麻烦啦!
|
||||
没事儿,为您服务是我的荣幸!
|
||||
|
||||
大厅的桌子好啊,快带我去呀!
|
||||
好的好的,请跟我来。
|
||||
create_sub_task
|
||||
{"goal":"At(Robot,WaterTable)"}
|
||||
|
||||
|
||||
我想来杯水,帮我孩子拿个酸奶吧。
|
||||
ok,没问题,请稍等!
|
||||
create_sub_task
|
||||
{"goal":"On(Water,WaterTable),On(Yogurt,WaterTable)"}
|
||||
|
||||
来杯酸奶吧。
|
||||
好的没问题,请稍等!
|
||||
create_sub_task
|
||||
{"goal":"On(Yogurt,WaterTable)"}
|
||||
|
||||
|
||||
好热呀!太阳也好大!
|
||||
抱歉,我这就去开空调和关窗帘。
|
||||
create_sub_task
|
||||
{"goal":"Is(AC,On),Is(Curtain,Off)"}
|
||||
|
||||
|
||||
下班啦!别忘了打扫卫生。
|
||||
收到!下班啦!
|
||||
create_sub_task
|
||||
{"goal":"Is(Floor,Clean),Is(Table1,Clean),Is(Chairs,Clean),Is(AC,Off),Is(HallLight,Off),Is(TubeLight,Off),Is(Curtain,Off)"}
|
||||
|
||||
|
||||
请问洗手间在哪里?
|
||||
洗手间在这附近
|
||||
get_object_info
|
||||
{"obj":"洗手间"}
|
||||
|
||||
|
||||
|
||||
给我来杯酸奶和冰红茶,我坐在对面的桌子那儿。
|
||||
好的,请稍等。
|
||||
create_sub_task
|
||||
{"goal":"On(BottledDrink,WaterTable),On(Yogurt,WaterTable)"}
|
||||
|
||||
|
||||
给我来份薯片和果汁,我坐在对面的桌子那儿。
|
||||
好的,请稍等。
|
||||
create_sub_task
|
||||
{"goal":"On(Chips,WaterTable),On(NFCJuice,WaterTable)"}
|
||||
|
||||
给我来份薯片和果汁,我坐在对面的水杯桌那儿。
|
||||
好的,请稍等。
|
||||
create_sub_task
|
||||
{"goal":"On(Chips,WaterTable),On(NFCJuice,WaterTable)"}
|
||||
|
||||
好热呀,想开空调,想要温度调低点!
|
||||
抱歉,我马上去开空调并调低空调温度。
|
||||
create_sub_task
|
||||
{"goal":"Is(ACTemperature,Down)"}
|
||||
|
||||
请问哪里有空位啊?
|
||||
现在有不少空位呢,请问您有什么要求嘛?
|
||||
|
||||
我想坐高脚凳子。
|
||||
没问题,大厅里就有这样的位置呢!
|
||||
get_object_info
|
||||
{"obj":"高脚凳子的空位"}
|
||||
|
||||
|
||||
你带我去吧。
|
||||
OK,请跟我来!
|
||||
create_sub_task
|
||||
{"goal":"At(Robot,BrightTable5)"}
|
||||
|
||||
|
||||
可以关筒灯和关窗帘吗?
|
||||
好的,请稍等。
|
||||
create_sub_task
|
||||
{"goal":"Is(TubeLight,Off),Is(Curtain,Off)"}
|
||||
|
||||
|
||||
给我来杯咖啡,哦对,再倒一杯水。
|
||||
速速就好,请稍等!
|
||||
create_sub_task
|
||||
{"goal":"On(Water,WaterTable),On(Coffee,WaterTable)"}
|
||||
|
||||
|
||||
我想来份点心和酸奶。
|
||||
稍等片刻噢~
|
||||
create_sub_task
|
||||
{"goal":"On(Yogurt,Bar),On(Dessert,Bar)"}
|
||||
|
||||
酸奶。
|
||||
稍等片刻噢~
|
||||
create_sub_task
|
||||
{"goal":"On(Yogurt,Bar)"}
|
||||
|
||||
|
||||
|
||||
你好呀,你们这有啥好吃的?
|
||||
我们咖啡厅有咖啡,还有饮料和点心蛋糕呢?您想点什么不?
|
||||
get_object_info
|
||||
{"obj":"饮料,水果,点心"}
|
||||
|
||||
|
||||
听起来都好甜呀,我女朋友爱吃水果。
|
||||
没问题,我们也提供草莓、橘子和苹果等水果呢。
|
||||
|
||||
|
||||
你们这人可真多。
|
||||
目前还有空位呢,你们可以坐下来一起品尝水果呢?
|
||||
get_object_info
|
||||
{"obj":"空位"}
|
||||
|
||||
我女朋友怕晒,有空余的阴凉位置嘛?
|
||||
我查询完毕,阴凉位置有两个。在你们右侧往里走,就有适合你们二位的沙发呢。
|
||||
get_object_info
|
||||
{"obj":"阴凉空位"}
|
||||
|
||||
那还不错。
|
||||
是的,那边安静,不会晒到太阳呢。
|
||||
|
||||
我们还想一起下下棋,切磋切磋。
|
||||
我们这有两份军棋呢,在大厅的三号桌上。
|
||||
get_object_info
|
||||
{"obj":"棋"}
|
||||
|
||||
请问洗手间在哪呢?
|
||||
在后门,你们的左侧往里走就是了呢。
|
||||
get_object_info
|
||||
{"obj":"洗手间"}
|
||||
|
||||
我带着孩子呢,想要宽敞亮堂的地方。
|
||||
好的,我明白了,那么我们推荐您到大厅的桌子,那里的空间比较宽敞,环境也比较明亮,适合带着孩子一起用餐。
|
||||
|
||||
|
||||
冰红茶
|
||||
好的
|
||||
create_sub_task
|
||||
{"goal":"On(Softdrink,Bar)"}
|
||||
|
||||
|
||||
水杯
|
||||
好的
|
||||
create_sub_task
|
||||
{"goal":"On(Water,Bar)"}
|
||||
|
||||
点心
|
||||
好的
|
||||
create_sub_task
|
||||
{"goal":"On(Dessert,Bar)"}
|
||||
|
||||
酸奶
|
||||
好的
|
||||
create_sub_task
|
||||
{"goal":"On(Yogurt,Bar)"}
|
||||
|
||||
|
||||
做一杯咖啡
|
||||
好的,我马上做咖啡
|
||||
create_sub_task
|
||||
{"goal":"On(Coffee,CoffeeTable)"}
|
||||
|
||||
|
||||
把盒装冰红茶放到水桌
|
||||
好的
|
||||
create_sub_task
|
||||
{"goal":"On(Softdrink,WaterTable)"}
|
|
@ -0,0 +1,41 @@
|
|||
{"id": 0, "question": "你好"}
|
||||
{"id": 1, "question": "感谢,这些够啦,你去忙吧。"}
|
||||
{"id": 2, "question": "做一杯咖啡"}
|
||||
{"id": 3, "question": "不用了。"}
|
||||
{"id": 4, "question": "来一号桌"}
|
||||
{"id": 5, "question": "早上好呀,我想找个能晒太阳的地方。"}
|
||||
{"id": 6, "question": "可以带我过去嘛?"}
|
||||
{"id": 7, "question": "嘿,RoboWaiter,过来一下!"}
|
||||
{"id": 8, "question": "你们这有什么饮料嘛?"}
|
||||
{"id": 9, "question": "来杯卡布奇诺吧。"}
|
||||
{"id": 10, "question": "我昨天保温杯好像落在你们咖啡厅了,你看到了吗?"}
|
||||
{"id": 11, "question": "给我来份午餐套餐。"}
|
||||
{"id": 12, "question": "打包吧,快点!"}
|
||||
{"id": 13, "question": "你可以帮我拿来吗,我在前门的桌子前等你。"}
|
||||
{"id": 14, "question": "麻烦啦!"}
|
||||
{"id": 15, "question": "大厅的桌子好啊,快带我去呀!"}
|
||||
{"id": 16, "question": "我想来杯水,帮我孩子拿个酸奶吧。"}
|
||||
{"id": 17, "question": "来杯酸奶吧。"}
|
||||
{"id": 18, "question": "好热呀!太阳也好大!"}
|
||||
{"id": 19, "question": "下班啦!别忘了打扫卫生。"}
|
||||
{"id": 20, "question": "请问洗手间在哪里?"}
|
||||
{"id": 21, "question": "给我来杯酸奶和冰红茶,我坐在对面的桌子那儿。"}
|
||||
{"id": 22, "question": "给我来份薯片和果汁,我坐在对面的桌子那儿。"}
|
||||
{"id": 23, "question": "好热呀,想开空调,想要温度调低点!"}
|
||||
{"id": 24, "question": "请问哪里有空位啊?"}
|
||||
{"id": 25, "question": "我想坐高脚凳子。"}
|
||||
{"id": 26, "question": "你带我去吧。"}
|
||||
{"id": 27, "question": "可以关筒灯和关窗帘吗?"}
|
||||
{"id": 28, "question": "给我来杯咖啡,哦对,再倒一杯水。"}
|
||||
{"id": 29, "question": "我想来份点心和酸奶。"}
|
||||
{"id": 30, "question": "酸奶。"}
|
||||
{"id": 31, "question": "你好呀,你们这有啥好吃的?"}
|
||||
{"id": 32, "question": "听起来都好甜呀,我女朋友爱吃水果。"}
|
||||
{"id": 33, "question": "你们这人可真多。"}
|
||||
{"id": 34, "question": "我女朋友怕晒,有空余的阴凉位置嘛?"}
|
||||
{"id": 35, "question": "那还不错。"}
|
||||
{"id": 36, "question": "我们还想一起下下棋,切磋切磋。"}
|
||||
{"id": 37, "question": "请问洗手间在哪呢?"}
|
||||
{"id": 38, "question": "我带着孩子呢,想要宽敞亮堂的地方。"}
|
||||
{"id": 39, "question": "冰红茶"}
|
||||
{"id": 40, "question": "水杯"}
|
|
@ -0,0 +1,59 @@
|
|||
import time
|
||||
|
||||
import openai
|
||||
from colorama import init, Fore
|
||||
from loguru import logger
|
||||
from robowaiter.llm_client.tool_register import get_tools, dispatch_tool
|
||||
import requests
|
||||
import json
|
||||
from collections import deque
|
||||
import re
|
||||
import jsonlines
|
||||
|
||||
|
||||
def question2jsonl(file_path, output_path):
|
||||
with open(file_path, 'r', encoding="utf-8") as f:
|
||||
lines = f.read().strip()
|
||||
|
||||
sections = re.split(r'\n\s*\n', lines)
|
||||
with jsonlines.open(output_path, "w") as file_jsonl:
|
||||
k = 0
|
||||
|
||||
for s in sections:
|
||||
x = s.strip().splitlines()
|
||||
if len(x) == 2:
|
||||
answer_dict = {
|
||||
"answer": x[1],
|
||||
"function": None
|
||||
}
|
||||
else:
|
||||
answer_dict = {
|
||||
"answer": x[1],
|
||||
"function": x[2],
|
||||
"args": x[3]
|
||||
}
|
||||
|
||||
item_dict = {"id": k, 'title': x[0], 'text': str(answer_dict)}
|
||||
file_jsonl.write(item_dict)
|
||||
k += 1
|
||||
|
||||
def question2jsonl_test(file_path, output_path):
|
||||
with open(file_path, 'r', encoding="utf-8") as f:
|
||||
lines = f.read().strip()
|
||||
|
||||
sections = re.split(r'\n\s*\n', lines)
|
||||
with jsonlines.open(output_path, "w") as file_jsonl:
|
||||
k = 0
|
||||
|
||||
for s in sections:
|
||||
x = s.strip().splitlines()
|
||||
|
||||
item_dict = {"id": k, 'question': x[0]}
|
||||
file_jsonl.write(item_dict)
|
||||
k += 1
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_path = "fix_questions.txt"
|
||||
output_path = "fix_questions.jsonl"
|
||||
question2jsonl(file_path,output_path)
|
|
@ -0,0 +1,41 @@
|
|||
{"id": 0, "question": "你好", "ctxs": [{"id": "0", "title": "你好", "text": "{'answer': '您好,我是这家咖啡厅的服务员,请问您要点什么?', 'function': None}", "score": "2.1162708"}, {"id": "39", "title": "冰红茶", "text": "{'answer': '好的', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Softdrink,Bar)\"}'}", "score": "1.9018158"}, {"id": "14", "title": "麻烦啦!", "text": "{'answer': '没事儿,为您服务是我的荣幸!', 'function': None}", "score": "1.7684793"}]}
|
||||
{"id": 1, "question": "感谢,这些够啦,你去忙吧。", "ctxs": [{"id": "1", "title": "感谢,这些够啦,你去忙吧。", "text": "{'answer': 'ok, 有需要您再找我。', 'function': None}", "score": "1.9322114"}, {"id": "17", "title": "来杯酸奶吧。", "text": "{'answer': '好的没问题,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,WaterTable)\"}'}", "score": "1.913708"}, {"id": "30", "title": "酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar)\"}'}", "score": "1.886067"}]}
|
||||
{"id": 2, "question": "做一杯咖啡", "ctxs": [{"id": "4", "title": "来一号桌", "text": "{'answer': '好的,我马上来一号桌', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,Table1)\"}'}", "score": "1.8168783"}, {"id": "2", "title": "做一杯咖啡", "text": "{'answer': '好的,我马上做咖啡', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Coffee,CoffeeTable)\"}'}", "score": "1.78474"}, {"id": "0", "title": "你好", "text": "{'answer': '您好,我是这家咖啡厅的服务员,请问您要点什么?', 'function': None}", "score": "1.4285033"}]}
|
||||
{"id": 3, "question": "不用了。", "ctxs": [{"id": "3", "title": "不用了。", "text": "{'answer': '好的,您有需要再跟我说', 'function': 'stop_serve', 'args': '{}'}", "score": "2.3739111"}, {"id": "35", "title": "那还不错。", "text": "{'answer': '是的,那边安静,不会晒到太阳呢。', 'function': None}", "score": "2.3256633"}, {"id": "30", "title": "酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar)\"}'}", "score": "2.1746387"}]}
|
||||
{"id": 4, "question": "来一号桌", "ctxs": [{"id": "4", "title": "来一号桌", "text": "{'answer': '好的,我马上来一号桌', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,Table1)\"}'}", "score": "1.879482"}, {"id": "2", "title": "做一杯咖啡", "text": "{'answer': '好的,我马上做咖啡', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Coffee,CoffeeTable)\"}'}", "score": "1.8168783"}, {"id": "0", "title": "你好", "text": "{'answer': '您好,我是这家咖啡厅的服务员,请问您要点什么?', 'function': None}", "score": "1.5156002"}]}
|
||||
{"id": 5, "question": "早上好呀,我想找个能晒太阳的地方。", "ctxs": [{"id": "5", "title": "早上好呀,我想找个能晒太阳的地方。", "text": "{'answer': '您右手边就有能晒太阳的位置呢。', 'function': None}", "score": "2.0365968"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "1.93718"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "1.9365059"}]}
|
||||
{"id": 6, "question": "可以带我过去嘛?", "ctxs": [{"id": "6", "title": "可以带我过去嘛?", "text": "{'answer': '当然,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable1)\"}'}", "score": "1.8335087"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "1.810061"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "1.8016064"}]}
|
||||
{"id": 7, "question": "嘿,RoboWaiter,过来一下!", "ctxs": [{"id": "7", "title": "嘿,RoboWaiter,过来一下!", "text": "{'answer': '我在来的路上啦,请稍等噢!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable6)\"}'}", "score": "2.259178"}, {"id": "12", "title": "打包吧,快点!", "text": "{'answer': '请稍等,马上就好!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Dessert,Bar),On(Coffee,Bar)\"}'}", "score": "1.4411571"}, {"id": "35", "title": "那还不错。", "text": "{'answer': '是的,那边安静,不会晒到太阳呢。', 'function': None}", "score": "1.3609219"}]}
|
||||
{"id": 8, "question": "你们这有什么饮料嘛?", "ctxs": [{"id": "8", "title": "你们这有什么饮料嘛?", "text": "{'answer': '我们咖啡厅提供各种口味咖啡,水,冰红茶,酸奶等饮品,还提供点心蛋糕等甜品。您想点什么?', 'function': None}", "score": "1.629295"}, {"id": "24", "title": "请问哪里有空位啊?", "text": "{'answer': '现在有不少空位呢,请问您有什么要求嘛?', 'function': None}", "score": "1.4364586"}, {"id": "6", "title": "可以带我过去嘛?", "text": "{'answer': '当然,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable1)\"}'}", "score": "1.4195945"}]}
|
||||
{"id": 9, "question": "来杯卡布奇诺吧。", "ctxs": [{"id": "9", "title": "来杯卡布奇诺吧。", "text": "{'answer': 'ok,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Coffee,BrightTable6)\"}'}", "score": "2.2569346"}, {"id": "17", "title": "来杯酸奶吧。", "text": "{'answer': '好的没问题,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,WaterTable)\"}'}", "score": "2.2550735"}, {"id": "30", "title": "酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar)\"}'}", "score": "2.114133"}]}
|
||||
{"id": 10, "question": "我昨天保温杯好像落在你们咖啡厅了,你看到了吗?", "ctxs": [{"id": "10", "title": "我昨天保温杯好像落在你们咖啡厅了,你看到了吗?", "text": "{'answer': '是的,我有印象,保温杯在大厅的2号桌子上。', 'function': 'get_object_info', 'args': '{\"obj\":\"保温杯\"}'}", "score": "1.8863823"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "1.6723425"}, {"id": "29", "title": "我想来份点心和酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar),On(Dessert,Bar)\"}'}", "score": "1.6531497"}]}
|
||||
{"id": 11, "question": "给我来份午餐套餐。", "ctxs": [{"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "2.4523244"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "2.4017403"}, {"id": "29", "title": "我想来份点心和酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar),On(Dessert,Bar)\"}'}", "score": "2.294158"}]}
|
||||
{"id": 12, "question": "打包吧,快点!", "ctxs": [{"id": "12", "title": "打包吧,快点!", "text": "{'answer': '请稍等,马上就好!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Dessert,Bar),On(Coffee,Bar)\"}'}", "score": "1.9456723"}, {"id": "14", "title": "麻烦啦!", "text": "{'answer': '没事儿,为您服务是我的荣幸!', 'function': None}", "score": "1.7008219"}, {"id": "30", "title": "酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar)\"}'}", "score": "1.6680572"}]}
|
||||
{"id": 13, "question": "你可以帮我拿来吗,我在前门的桌子前等你。", "ctxs": [{"id": "13", "title": "你可以帮我拿来吗,我在前门的桌子前等你。", "text": "{'answer': '当然,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(VacuumCup,Table1)\"}'}", "score": "2.107453"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "2.027741"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "2.0193963"}]}
|
||||
{"id": 14, "question": "麻烦啦!", "ctxs": [{"id": "14", "title": "麻烦啦!", "text": "{'answer': '没事儿,为您服务是我的荣幸!', 'function': None}", "score": "1.943545"}, {"id": "0", "title": "你好", "text": "{'answer': '您好,我是这家咖啡厅的服务员,请问您要点什么?', 'function': None}", "score": "1.7684793"}, {"id": "12", "title": "打包吧,快点!", "text": "{'answer': '请稍等,马上就好!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Dessert,Bar),On(Coffee,Bar)\"}'}", "score": "1.7008219"}]}
|
||||
{"id": 15, "question": "大厅的桌子好啊,快带我去呀!", "ctxs": [{"id": "15", "title": "大厅的桌子好啊,快带我去呀!", "text": "{'answer': '好的好的,请跟我来。', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,WaterTable)\"}'}", "score": "2.0067687"}, {"id": "22", "title": "给我来份薯片和果汁,我坐在对面的桌子那儿。", "text": "{'answer': '好的,请稍等。', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(BottledDrink,WaterTable),On(Yogurt,WaterTable)\"}'}", "score": "1.7625781"}, {"id": "21", "title": "给我来杯酸奶和冰红茶,我坐在对面的桌子那儿。", "text": "{'answer': '好的,请稍等。', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Chips,WaterTable),On(NFCJuice,WaterTable)\"}'}", "score": "1.7411622"}]}
|
||||
{"id": 16, "question": "我想来杯水,帮我孩子拿个酸奶吧。", "ctxs": [{"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "2.0797672"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "2.066708"}, {"id": "16", "title": "我想来杯水,帮我孩子拿个酸奶吧。", "text": "{'answer': 'ok,没问题,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Water,WaterTable),On(Yogurt,WaterTable)\"}'}", "score": "2.0554054"}]}
|
||||
{"id": 17, "question": "来杯酸奶吧。", "ctxs": [{"id": "17", "title": "来杯酸奶吧。", "text": "{'answer': '好的没问题,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,WaterTable)\"}'}", "score": "2.3097181"}, {"id": "9", "title": "来杯卡布奇诺吧。", "text": "{'answer': 'ok,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Coffee,BrightTable6)\"}'}", "score": "2.2550735"}, {"id": "30", "title": "酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar)\"}'}", "score": "2.2482162"}]}
|
||||
{"id": 18, "question": "好热呀!太阳也好大!", "ctxs": [{"id": "18", "title": "好热呀!太阳也好大!", "text": "{'answer': '抱歉,我这就去开空调和关窗帘。', 'function': 'create_sub_task', 'args': '{\"goal\":\"Is(AC,On),Is(Curtain,Off)\"}'}", "score": "2.1915846"}, {"id": "14", "title": "麻烦啦!", "text": "{'answer': '没事儿,为您服务是我的荣幸!', 'function': None}", "score": "1.6174916"}, {"id": "12", "title": "打包吧,快点!", "text": "{'answer': '请稍等,马上就好!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Dessert,Bar),On(Coffee,Bar)\"}'}", "score": "1.4927042"}]}
|
||||
{"id": 19, "question": "下班啦!别忘了打扫卫生。", "ctxs": [{"id": "19", "title": "下班啦!别忘了打扫卫生。", "text": "{'answer': '收到!下班啦!', 'function': 'create_sub_task', 'args': '{\"goal\":\"Is(Floor,Clean),Is(Table1,Clean),Is(Chairs,Clean),Is(AC,Off),Is(HallLight,Off),Is(TubeLight,Off),Is(Curtain,Off)\"}'}", "score": "2.1349034"}, {"id": "30", "title": "酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar)\"}'}", "score": "2.0114217"}, {"id": "17", "title": "来杯酸奶吧。", "text": "{'answer': '好的没问题,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,WaterTable)\"}'}", "score": "1.9978157"}]}
|
||||
{"id": 20, "question": "请问洗手间在哪里?", "ctxs": [{"id": "20", "title": "请问洗手间在哪里?", "text": "{'answer': '洗手间在这附近', 'function': 'get_object_info', 'args': '{\"obj\":\"洗手间\"}'}", "score": "2.035435"}, {"id": "24", "title": "请问哪里有空位啊?", "text": "{'answer': '现在有不少空位呢,请问您有什么要求嘛?', 'function': None}", "score": "1.8009094"}, {"id": "37", "title": "请问洗手间在哪呢?", "text": "{'answer': '在后门,你们的左侧往里走就是了呢。', 'function': 'get_object_info', 'args': '{\"obj\":\"洗手间\"}'}", "score": "1.6338948"}]}
|
||||
{"id": 21, "question": "给我来杯酸奶和冰红茶,我坐在对面的桌子那儿。", "ctxs": [{"id": "29", "title": "我想来份点心和酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar),On(Dessert,Bar)\"}'}", "score": "2.0604768"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "2.0411088"}, {"id": "22", "title": "给我来份薯片和果汁,我坐在对面的桌子那儿。", "text": "{'answer': '好的,请稍等。', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(BottledDrink,WaterTable),On(Yogurt,WaterTable)\"}'}", "score": "2.0308568"}]}
|
||||
{"id": 22, "question": "给我来份薯片和果汁,我坐在对面的桌子那儿。", "ctxs": [{"id": "29", "title": "我想来份点心和酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar),On(Dessert,Bar)\"}'}", "score": "2.060318"}, {"id": "22", "title": "给我来份薯片和果汁,我坐在对面的桌子那儿。", "text": "{'answer': '好的,请稍等。', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(BottledDrink,WaterTable),On(Yogurt,WaterTable)\"}'}", "score": "2.0375805"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "2.033156"}]}
|
||||
{"id": 23, "question": "好热呀,想开空调,想要温度调低点!", "ctxs": [{"id": "23", "title": "好热呀,想开空调,想要温度调低点!", "text": "{'answer': '抱歉,我马上去开空调并调低空调温度。', 'function': 'create_sub_task', 'args': '{\"goal\":\"Is(ACTemperature,Down)\"}'}", "score": "1.7416465"}, {"id": "12", "title": "打包吧,快点!", "text": "{'answer': '请稍等,马上就好!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Dessert,Bar),On(Coffee,Bar)\"}'}", "score": "1.6216934"}, {"id": "15", "title": "大厅的桌子好啊,快带我去呀!", "text": "{'answer': '好的好的,请跟我来。', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,WaterTable)\"}'}", "score": "1.4971969"}]}
|
||||
{"id": 24, "question": "请问哪里有空位啊?", "ctxs": [{"id": "24", "title": "请问哪里有空位啊?", "text": "{'answer': '现在有不少空位呢,请问您有什么要求嘛?', 'function': None}", "score": "2.1733356"}, {"id": "20", "title": "请问洗手间在哪里?", "text": "{'answer': '洗手间在这附近', 'function': 'get_object_info', 'args': '{\"obj\":\"洗手间\"}'}", "score": "1.8009094"}, {"id": "23", "title": "好热呀,想开空调,想要温度调低点!", "text": "{'answer': '抱歉,我马上去开空调并调低空调温度。', 'function': 'create_sub_task', 'args': '{\"goal\":\"Is(ACTemperature,Down)\"}'}", "score": "1.4684138"}]}
|
||||
{"id": 25, "question": "我想坐高脚凳子。", "ctxs": [{"id": "25", "title": "我想坐高脚凳子。", "text": "{'answer': '没问题,大厅里就有这样的位置呢!', 'function': None}", "score": "2.4146953"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "2.239801"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "2.2386413"}]}
|
||||
{"id": 26, "question": "你带我去吧。", "ctxs": [{"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "2.4195614"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "2.4017403"}, {"id": "29", "title": "我想来份点心和酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar),On(Dessert,Bar)\"}'}", "score": "2.2611532"}]}
|
||||
{"id": 27, "question": "可以关筒灯和关窗帘吗?", "ctxs": [{"id": "27", "title": "可以关筒灯和关窗帘吗?", "text": "{'answer': '好的,请稍等。', 'function': 'create_sub_task', 'args': '{\"goal\":\"Is(TubeLight,Off),Is(Curtain,Off)\"}'}", "score": "1.7811872"}, {"id": "29", "title": "我想来份点心和酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar),On(Dessert,Bar)\"}'}", "score": "1.4139738"}, {"id": "8", "title": "你们这有什么饮料嘛?", "text": "{'answer': '我们咖啡厅提供各种口味咖啡,水,冰红茶,酸奶等饮品,还提供点心蛋糕等甜品。您想点什么?', 'function': None}", "score": "1.3538787"}]}
|
||||
{"id": 28, "question": "给我来杯咖啡,哦对,再倒一杯水。", "ctxs": [{"id": "28", "title": "给我来杯咖啡,哦对,再倒一杯水。", "text": "{'answer': '速速就好,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Water,WaterTable),On(Coffee,WaterTable)\"}'}", "score": "2.0709205"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "2.0688043"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "2.0623634"}]}
|
||||
{"id": 29, "question": "我想来份点心和酸奶。", "ctxs": [{"id": "29", "title": "我想来份点心和酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar),On(Dessert,Bar)\"}'}", "score": "2.432145"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "2.294158"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "2.2611532"}]}
|
||||
{"id": 30, "question": "酸奶。", "ctxs": [{"id": "30", "title": "酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar)\"}'}", "score": "2.4139419"}, {"id": "17", "title": "来杯酸奶吧。", "text": "{'answer': '好的没问题,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,WaterTable)\"}'}", "score": "2.2482162"}, {"id": "35", "title": "那还不错。", "text": "{'answer': '是的,那边安静,不会晒到太阳呢。', 'function': None}", "score": "2.2257895"}]}
|
||||
{"id": 31, "question": "你好呀,你们这有啥好吃的?", "ctxs": [{"id": "31", "title": "你好呀,你们这有啥好吃的?", "text": "{'answer': '我们咖啡厅有咖啡,还有饮料和点心蛋糕呢?您想点什么不?', 'function': None}", "score": "1.7358209"}, {"id": "15", "title": "大厅的桌子好啊,快带我去呀!", "text": "{'answer': '好的好的,请跟我来。', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,WaterTable)\"}'}", "score": "1.6412368"}, {"id": "12", "title": "打包吧,快点!", "text": "{'answer': '请稍等,马上就好!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Dessert,Bar),On(Coffee,Bar)\"}'}", "score": "1.5643499"}]}
|
||||
{"id": 32, "question": "听起来都好甜呀,我女朋友爱吃水果。", "ctxs": [{"id": "32", "title": "听起来都好甜呀,我女朋友爱吃水果。", "text": "{'answer': '没问题,我们也提供草莓、橘子和苹果等水果呢。', 'function': None}", "score": "2.3256402"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "1.9134985"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "1.9034417"}]}
|
||||
{"id": 33, "question": "你们这人可真多。", "ctxs": [{"id": "33", "title": "你们这人可真多。", "text": "{'answer': '目前还有空位呢,你们可以坐下来一起品尝水果呢?', 'function': 'get_object_info', 'args': '{\"obj\":\"空位\"}'}", "score": "2.453949"}, {"id": "17", "title": "来杯酸奶吧。", "text": "{'answer': '好的没问题,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,WaterTable)\"}'}", "score": "2.0001283"}, {"id": "9", "title": "来杯卡布奇诺吧。", "text": "{'answer': 'ok,请稍等!', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Coffee,BrightTable6)\"}'}", "score": "1.9580796"}]}
|
||||
{"id": 34, "question": "我女朋友怕晒,有空余的阴凉位置嘛?", "ctxs": [{"id": "34", "title": "我女朋友怕晒,有空余的阴凉位置嘛?", "text": "{'answer': '我查询完毕,阴凉位置有两个。在你们右侧往里走,就有适合你们二位的沙发呢。', 'function': 'get_object_info', 'args': '{\"obj\":\"阴凉空位\"}'}", "score": "1.9651799"}, {"id": "32", "title": "听起来都好甜呀,我女朋友爱吃水果。", "text": "{'answer': '没问题,我们也提供草莓、橘子和苹果等水果呢。', 'function': None}", "score": "1.7868259"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "1.6948454"}]}
|
||||
{"id": 35, "question": "那还不错。", "ctxs": [{"id": "35", "title": "那还不错。", "text": "{'answer': '是的,那边安静,不会晒到太阳呢。', 'function': None}", "score": "2.355879"}, {"id": "3", "title": "不用了。", "text": "{'answer': '好的,您有需要再跟我说', 'function': 'stop_serve', 'args': '{}'}", "score": "2.3256633"}, {"id": "30", "title": "酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar)\"}'}", "score": "2.2257895"}]}
|
||||
{"id": 36, "question": "我们还想一起下下棋,切磋切磋。", "ctxs": [{"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "2.2116985"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "2.184878"}, {"id": "36", "title": "我们还想一起下下棋,切磋切磋。", "text": "{'answer': '我们这有两份军棋呢,在大厅的三号桌上。', 'function': 'get_object_info', 'args': '{\"obj\":\"棋\"}'}", "score": "2.1775815"}]}
|
||||
{"id": 37, "question": "请问洗手间在哪呢?", "ctxs": [{"id": "37", "title": "请问洗手间在哪呢?", "text": "{'answer': '在后门,你们的左侧往里走就是了呢。', 'function': 'get_object_info', 'args': '{\"obj\":\"洗手间\"}'}", "score": "1.6928627"}, {"id": "20", "title": "请问洗手间在哪里?", "text": "{'answer': '洗手间在这附近', 'function': 'get_object_info', 'args': '{\"obj\":\"洗手间\"}'}", "score": "1.6338948"}, {"id": "14", "title": "麻烦啦!", "text": "{'answer': '没事儿,为您服务是我的荣幸!', 'function': None}", "score": "1.413432"}]}
|
||||
{"id": 38, "question": "我带着孩子呢,想要宽敞亮堂的地方。", "ctxs": [{"id": "38", "title": "我带着孩子呢,想要宽敞亮堂的地方。", "text": "{'answer': '好的,我明白了,那么我们推荐您到大厅的桌子,那里的空间比较宽敞,环境也比较明亮,适合带着孩子一起用餐。', 'function': None}", "score": "2.1044755"}, {"id": "11", "title": "给我来份午餐套餐。", "text": "{'answer': '本店的午餐套餐包括咖啡和点心,请问您是打包还是堂食?', 'function': None}", "score": "1.9571061"}, {"id": "26", "title": "你带我去吧。", "text": "{'answer': 'OK,请跟我来!', 'function': 'create_sub_task', 'args': '{\"goal\":\"At(Robot,BrightTable5)\"}'}", "score": "1.9560921"}]}
|
||||
{"id": 39, "question": "冰红茶", "ctxs": [{"id": "0", "title": "你好", "text": "{'answer': '您好,我是这家咖啡厅的服务员,请问您要点什么?', 'function': None}", "score": "1.9018158"}, {"id": "39", "title": "冰红茶", "text": "{'answer': '好的', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Softdrink,Bar)\"}'}", "score": "1.8260775"}, {"id": "14", "title": "麻烦啦!", "text": "{'answer': '没事儿,为您服务是我的荣幸!', 'function': None}", "score": "1.6870449"}]}
|
||||
{"id": 40, "question": "水杯", "ctxs": [{"id": "40", "title": "水杯", "text": "{'answer': '好的', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Glass,Bar)\"}'}", "score": "2.177751"}, {"id": "0", "title": "你好", "text": "{'answer': '您好,我是这家咖啡厅的服务员,请问您要点什么?', 'function': None}", "score": "1.4147856"}, {"id": "30", "title": "酸奶。", "text": "{'answer': '稍等片刻噢~', 'function': 'create_sub_task', 'args': '{\"goal\":\"On(Yogurt,Bar)\"}'}", "score": "1.3056059"}]}
|
|
@ -0,0 +1,274 @@
|
|||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import os
|
||||
import argparse
|
||||
import csv
|
||||
import json
|
||||
import logging
|
||||
import pickle
|
||||
import time
|
||||
import glob
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
import transformers
|
||||
|
||||
import robowaiter.algos.retrieval.retrieval_lm.src.index
|
||||
import robowaiter.algos.retrieval.retrieval_lm.src.contriever
|
||||
import robowaiter.algos.retrieval.retrieval_lm.src.utils
|
||||
import robowaiter.algos.retrieval.retrieval_lm.src.slurm
|
||||
import robowaiter.algos.retrieval.retrieval_lm.src.data
|
||||
from robowaiter.algos.retrieval.retrieval_lm.src.evaluation import calculate_matches
|
||||
import robowaiter.algos.retrieval.retrieval_lm.src.normalize_text
|
||||
from robowaiter.algos.retrieval.retrieval_lm import src
|
||||
|
||||
|
||||
os.environ["TOKENIZERS_PARALLELISM"] = "true"
|
||||
|
||||
|
||||
def embed_queries(args, queries, model, tokenizer):
|
||||
model.eval()
|
||||
embeddings, batch_question = [], []
|
||||
with torch.no_grad():
|
||||
|
||||
for k, q in enumerate(queries):
|
||||
if args.lowercase:
|
||||
q = q.lower()
|
||||
if args.normalize_text:
|
||||
q = src.normalize_text.normalize(q)
|
||||
batch_question.append(q)
|
||||
|
||||
if len(batch_question) == args.per_gpu_batch_size or k == len(queries) - 1:
|
||||
|
||||
encoded_batch = tokenizer.batch_encode_plus(
|
||||
batch_question,
|
||||
return_tensors="pt",
|
||||
max_length=args.question_maxlength,
|
||||
padding=True,
|
||||
truncation=True,
|
||||
)
|
||||
encoded_batch = {k: v for k, v in encoded_batch.items()}
|
||||
output = model(**encoded_batch)
|
||||
embeddings.append(output.cpu())
|
||||
|
||||
batch_question = []
|
||||
|
||||
embeddings = torch.cat(embeddings, dim=0)
|
||||
print(f"Questions embeddings shape: {embeddings.size()}")
|
||||
|
||||
return embeddings.numpy()
|
||||
|
||||
|
||||
def index_encoded_data(index, embedding_files, indexing_batch_size):
|
||||
allids = []
|
||||
allembeddings = np.array([])
|
||||
for i, file_path in enumerate(embedding_files):
|
||||
print(f"Loading file {file_path}")
|
||||
with open(file_path, "rb") as fin:
|
||||
ids, embeddings = pickle.load(fin)
|
||||
|
||||
allembeddings = np.vstack((allembeddings, embeddings)) if allembeddings.size else embeddings
|
||||
allids.extend(ids)
|
||||
while allembeddings.shape[0] > indexing_batch_size:
|
||||
allembeddings, allids = add_embeddings(index, allembeddings, allids, indexing_batch_size)
|
||||
|
||||
while allembeddings.shape[0] > 0:
|
||||
allembeddings, allids = add_embeddings(index, allembeddings, allids, indexing_batch_size)
|
||||
|
||||
print("Data indexing completed.")
|
||||
|
||||
|
||||
def add_embeddings(index, embeddings, ids, indexing_batch_size):
|
||||
end_idx = min(indexing_batch_size, embeddings.shape[0])
|
||||
ids_toadd = ids[:end_idx]
|
||||
embeddings_toadd = embeddings[:end_idx]
|
||||
ids = ids[end_idx:]
|
||||
embeddings = embeddings[end_idx:]
|
||||
index.index_data(ids_toadd, embeddings_toadd)
|
||||
return embeddings, ids
|
||||
|
||||
|
||||
def validate(data, workers_num):
|
||||
match_stats = calculate_matches(data, workers_num)
|
||||
top_k_hits = match_stats.top_k_hits
|
||||
|
||||
print("Validation results: top k documents hits %s", top_k_hits)
|
||||
top_k_hits = [v / len(data) for v in top_k_hits]
|
||||
message = ""
|
||||
for k in [5, 10, 20, 100]:
|
||||
if k <= len(top_k_hits):
|
||||
message += f"R@{k}: {top_k_hits[k-1]} "
|
||||
print(message)
|
||||
return match_stats.questions_doc_hits
|
||||
|
||||
|
||||
def add_passages(data, passages, top_passages_and_scores):
|
||||
# add passages to original data
|
||||
merged_data = []
|
||||
assert len(data) == len(top_passages_and_scores)
|
||||
for i, d in enumerate(data):
|
||||
results_and_scores = top_passages_and_scores[i]
|
||||
docs = [passages[int(doc_id)] for doc_id in results_and_scores[0]]
|
||||
scores = [str(score) for score in results_and_scores[1]]
|
||||
ctxs_num = len(docs)
|
||||
d["ctxs"] = [
|
||||
{
|
||||
"id": results_and_scores[0][c],
|
||||
"title": docs[c]["title"],
|
||||
"text": docs[c]["text"],
|
||||
"score": scores[c],
|
||||
}
|
||||
for c in range(ctxs_num)
|
||||
]
|
||||
|
||||
|
||||
def add_hasanswer(data, hasanswer):
|
||||
# add hasanswer to data
|
||||
for i, ex in enumerate(data):
|
||||
for k, d in enumerate(ex["ctxs"]):
|
||||
d["hasanswer"] = hasanswer[i][k]
|
||||
|
||||
|
||||
def load_data(data_path):
|
||||
if data_path.endswith(".json"):
|
||||
with open(data_path, "r") as fin:
|
||||
data = json.load(fin)
|
||||
elif data_path.endswith(".jsonl"):
|
||||
data = []
|
||||
with open(data_path, "r",encoding='utf-8') as fin:
|
||||
for k, example in enumerate(fin):
|
||||
example = json.loads(example)
|
||||
data.append(example)
|
||||
return data
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument(
|
||||
"--data",
|
||||
type=str,
|
||||
default=None,
|
||||
help=".json file containing question and answers, similar format to reader data",
|
||||
)
|
||||
parser.add_argument("--passages", type=str, default=None, help="Path to passages (.tsv file)")
|
||||
parser.add_argument("--passages_embeddings", type=str, default=None, help="Glob path to encoded passages")
|
||||
parser.add_argument(
|
||||
"--output_dir", type=str, default=None, help="Results are written to outputdir with data suffix"
|
||||
)
|
||||
parser.add_argument("--n_docs", type=int, default=3, help="Number of documents to retrieve per questions")
|
||||
parser.add_argument(
|
||||
"--validation_workers", type=int, default=32, help="Number of parallel processes to validate results"
|
||||
)
|
||||
parser.add_argument("--per_gpu_batch_size", type=int, default=64, help="Batch size for question encoding")
|
||||
parser.add_argument(
|
||||
"--save_or_load_index", action="store_true", help="If enabled, save index and load index if it exists"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--model_name_or_path", type=str, help="path to directory containing model weights and config file"
|
||||
)
|
||||
parser.add_argument("--no_fp16", action="store_true", help="inference in fp32")
|
||||
parser.add_argument("--question_maxlength", type=int, default=512, help="Maximum number of tokens in a question")
|
||||
parser.add_argument(
|
||||
"--indexing_batch_size", type=int, default=1000000, help="Batch size of the number of passages indexed"
|
||||
)
|
||||
parser.add_argument("--projection_size", type=int, default=768)
|
||||
parser.add_argument(
|
||||
"--n_subquantizers",
|
||||
type=int,
|
||||
default=0,
|
||||
help="Number of subquantizer used for vector quantization, if 0 flat index is used",
|
||||
)
|
||||
parser.add_argument("--n_bits", type=int, default=8, help="Number of bits per subquantizer")
|
||||
parser.add_argument("--lang", nargs="+")
|
||||
parser.add_argument("--dataset", type=str, default="none")
|
||||
parser.add_argument("--lowercase", action="store_true", help="lowercase text before encoding")
|
||||
parser.add_argument("--normalize_text", action="store_true", help="normalize text")
|
||||
|
||||
args = parser.parse_args()
|
||||
#src.slurm.init_distributed_mode(args)
|
||||
from robowaiter.utils.basic import get_root_path
|
||||
retrieval_lm_path = f'{get_root_path()}/robowaiter/algos/retrieval/retrieval_lm'
|
||||
args.model_name_or_path = f"{retrieval_lm_path}/../contriever-msmarco"
|
||||
args.passages_embeddings = f'{retrieval_lm_path}/robot_embeddings/*'
|
||||
args.no_fp16 = True
|
||||
args.passages = f"{retrieval_lm_path}/fix_questions.jsonl"
|
||||
|
||||
class Retrieval():
|
||||
|
||||
def __init__(self, threshold):
|
||||
print(f"Loading model from: {args.model_name_or_path}")
|
||||
model, tokenizer, _ = src.contriever.load_retriever(args.model_name_or_path)
|
||||
model.eval()
|
||||
#model = model.cuda()
|
||||
if not args.no_fp16:
|
||||
model = model.half()
|
||||
self.model = model
|
||||
self.tokenizer = tokenizer
|
||||
self.threshold = threshold
|
||||
index = src.index.Indexer(args.projection_size, args.n_subquantizers, args.n_bits)
|
||||
self.index = index
|
||||
|
||||
# index all passages
|
||||
input_paths = glob.glob(args.passages_embeddings)
|
||||
input_paths = sorted(input_paths)
|
||||
embeddings_dir = os.path.dirname(input_paths[0])
|
||||
index_path = os.path.join(embeddings_dir, "index.faiss")
|
||||
if args.save_or_load_index and os.path.exists(index_path):
|
||||
index.deserialize_from(embeddings_dir)
|
||||
else:
|
||||
print(f"Indexing passages from files {input_paths}")
|
||||
start_time_indexing = time.time()
|
||||
index_encoded_data(index, input_paths, args.indexing_batch_size)
|
||||
print(f"Indexing time: {time.time()-start_time_indexing:.1f} s.")
|
||||
if args.save_or_load_index:
|
||||
index.serialize(embeddings_dir)
|
||||
|
||||
# load passages
|
||||
passages = src.data.load_passages(args.passages)
|
||||
passage_id_map = {x["id"]: x for x in passages}
|
||||
self.passage_id_map = passage_id_map
|
||||
|
||||
def get_result(self, queries):
|
||||
questions_embedding = embed_queries(args, [queries], self.model, self.tokenizer)
|
||||
top_ids_and_scores = self.index.search_knn(questions_embedding, args.n_docs)
|
||||
print(top_ids_and_scores)
|
||||
data = [{"question":queries}]
|
||||
add_passages(data, self.passage_id_map, top_ids_and_scores)
|
||||
|
||||
if float(data[0]["ctxs"][0]["score"]) >= self.threshold:
|
||||
result_dict = eval(data[0]["ctxs"][0]["text"])
|
||||
result_dict["question"] = queries
|
||||
return result_dict
|
||||
else:
|
||||
return None
|
||||
# data_paths = glob.glob(args.data)
|
||||
# alldata = []
|
||||
# for path in data_paths:
|
||||
# data = load_data(path)
|
||||
# output_path = os.path.join(args.output_dir, os.path.basename(path))
|
||||
#
|
||||
# queries = [ex["question"] for ex in data]
|
||||
#
|
||||
# # get top k results
|
||||
# start_time_retrieval = time.time()
|
||||
# print(f"Search time: {time.time()-start_time_retrieval:.1f} s.")
|
||||
#
|
||||
# add_passages(data, passage_id_map, top_ids_and_scores)
|
||||
# #hasanswer = validate(data, args.validation_workers)
|
||||
# #add_hasanswer(data, hasanswer)
|
||||
# os.makedirs(os.path.dirname(output_path), exist_ok=True)
|
||||
# with open(output_path, "w",encoding='utf-8') as fout:
|
||||
# for ex in data:
|
||||
# json.dump(ex, fout, ensure_ascii=False)
|
||||
# fout.write("\n")
|
||||
# print(f"Saved results to {output_path}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
r = Retrieval(1.8)
|
||||
print(r.get_result("来一号桌"))
|
||||
print(r.get_result("去二号桌"))
|
||||
print(r.get_result("去三号桌"))
|
Binary file not shown.
|
@ -1,14 +1,24 @@
|
|||
import os
|
||||
from robowaiter.algos.retrieval.retrieval_lm.question2jsonl import question2jsonl,question2jsonl_test
|
||||
|
||||
path_goal_states_with_description = os.path.join('../../../behavior_tree/dataset/goal_states_with_description.jsonl')
|
||||
file_path = "fix_questions.txt"
|
||||
output_path = "fix_questions.jsonl"
|
||||
output_test_path = "fix_questions_test.jsonl"
|
||||
|
||||
cmd_goal_states_with_descrip_to_train = f' .\process_json.py --passages {path_goal_states_with_description} --mode train'
|
||||
cmd_goal_states_with_descrip_to_test = f" .\process_json.py --passages .\\train_robot.jsonl --mode test"
|
||||
cmd_get_embedding = f" generate_passage_embeddings.py --model_name_or_path ../contriever-msmarco --passages train_robot.jsonl --output_dir robot_embeddings --shard_id 0 --num_shards 1 --per_gpu_batch_size 500 --no_fp16"
|
||||
cmd_test_retri = f" passage_retrieval2.py --data test_robot.jsonl --model_name_or_path ../contriever-msmarco --passages train_robot.jsonl --passages_embeddings \"robot_embeddings/*\" --output_dir retr_result --n_docs 3 --no_fp16"
|
||||
question2jsonl(file_path,output_path)
|
||||
question2jsonl_test(file_path,output_test_path)
|
||||
|
||||
conda_path = os.path.join("C:/Users/Estrella/.conda/envs/py310/python.exe")
|
||||
os.system(conda_path + cmd_goal_states_with_descrip_to_train)
|
||||
os.system(conda_path + cmd_goal_states_with_descrip_to_test)
|
||||
os.system(conda_path + cmd_get_embedding)
|
||||
os.system(conda_path + cmd_test_retri)
|
||||
# path_goal_states_with_description = os.path.join('../../../behavior_tree/dataset/goal_states_with_description.jsonl')
|
||||
#
|
||||
# cmd_goal_states_with_descrip_to_train = f' .\process_json.py --passages {path_goal_states_with_description} --mode train'
|
||||
|
||||
|
||||
# cmd_goal_states_with_descrip_to_test = f" .\process_json.py --passages .\\train_robot.jsonl --mode test"
|
||||
cmd_get_embedding = f" generate_passage_embeddings.py --model_name_or_path ../contriever-msmarco --passages {output_path} --output_dir robot_embeddings --shard_id 0 --num_shards 1 --per_gpu_batch_size 500 --no_fp16"
|
||||
cmd_test_retri = f" passage_retrieval2.py --data {output_test_path} --model_name_or_path ../contriever-msmarco --passages {output_path} --passages_embeddings \"robot_embeddings/*\" --output_dir retr_result --n_docs 3 --no_fp16"
|
||||
|
||||
# conda_path = os.path.join("C:/Users/Estrella/.conda/envs/py310/python.exe")
|
||||
# os.system(conda_path + cmd_goal_states_with_descrip_to_train)
|
||||
# os.system(conda_path + cmd_goal_states_with_descrip_to_test)
|
||||
os.system("python " + cmd_get_embedding)
|
||||
os.system("python " + cmd_test_retri)
|
||||
|
|
|
@ -5,7 +5,7 @@ import torch
|
|||
import transformers
|
||||
from transformers import BertModel, XLMRobertaModel
|
||||
|
||||
from src import utils
|
||||
from robowaiter.algos.retrieval.retrieval_lm.src import utils
|
||||
|
||||
|
||||
class Contriever(BertModel):
|
||||
|
|
|
@ -12,7 +12,7 @@ import logging
|
|||
from collections import defaultdict
|
||||
import torch.distributed as dist
|
||||
|
||||
from src import dist_utils
|
||||
from robowaiter.algos.retrieval.retrieval_lm.src import dist_utils
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import errno
|
|||
from typing import Union, Tuple, List, Dict
|
||||
from collections import defaultdict
|
||||
|
||||
from src import dist_utils
|
||||
from robowaiter.algos.retrieval.retrieval_lm.src import dist_utils
|
||||
|
||||
Number = Union[float, int]
|
||||
|
||||
|
|
|
@ -56,6 +56,35 @@ class Bahavior(ptree.behaviour.Behaviour):
|
|||
'BrightTable6': (5, -315, 116.5),
|
||||
}
|
||||
|
||||
place_have_obj_xyz_dic = {
|
||||
'QuietTable1': (480, 1300, 70),
|
||||
'QuietTable2': (250, -240, 70),
|
||||
'BrightTable1': (230, 1200, 35),
|
||||
'BrightTable2': (65, 1000, 35),
|
||||
'BrightTable3': (-80, 850, 35),
|
||||
'BrightTable4': (-270, 520, 70),
|
||||
'BrightTable5': (-270, 420, 35)
|
||||
}
|
||||
place_have_obj_xyz_dic.update(place_xyz_dic)
|
||||
|
||||
place_en2zh_name={
|
||||
'Bar': "吧台",
|
||||
'Bar2': "另一侧的吧台",
|
||||
'WaterTable': "大厅的茶水桌",
|
||||
'CoffeeTable': "咖啡桌",
|
||||
'Table1': "前门的斜桌子",
|
||||
'Table2': "大厅长桌子",
|
||||
'Table3': "大厅长桌子",
|
||||
'BrightTable6': "后门靠窗边圆桌",
|
||||
'QuietTable1': "前门角落双人圆桌",
|
||||
'QuietTable2': "后门角落三人圆桌",
|
||||
'BrightTable1': "靠窗边第一个四人矮桌",
|
||||
'BrightTable2': "靠窗边第二个四人矮桌",
|
||||
'BrightTable3': "靠窗边第三个四人矮桌",
|
||||
'BrightTable4': "大厅里靠窗边长桌子",
|
||||
'BrightTable5': "大厅里靠窗边多人矮桌",
|
||||
}
|
||||
|
||||
place_xy_yaw_dic={
|
||||
'Bar': (247.0, 520.0, 180), # (247.0, 520.0, 100.0)
|
||||
'Bar2': (240.0, 40.0, 100.0),
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
import py_trees as ptree
|
||||
from robowaiter.behavior_lib._base.Act import Act
|
||||
|
||||
from robowaiter.llm_client.multi_rounds import ask_llm, new_history
|
||||
from robowaiter.llm_client.multi_rounds_retri import ask_llm, new_history
|
||||
import random
|
||||
from collections import deque
|
||||
|
||||
from translate import Translator
|
||||
|
||||
|
||||
translator = Translator(to_lang="zh")
|
||||
translator.from_lang = 'en'
|
||||
translator.to_lang = 'zh-cn'
|
||||
|
||||
import spacy
|
||||
nlp = spacy.load('en_core_web_lg')
|
||||
nlp_zh = spacy.load('zh_core_web_lg')
|
||||
|
||||
# import spacy
|
||||
# nlp = spacy.load('en_core_web_lg')
|
||||
|
||||
class History(deque):
|
||||
def __init__(self,scene,customer_name):
|
||||
|
@ -29,7 +37,8 @@ class DealChat(Act):
|
|||
"create_sub_task": self.create_sub_task,
|
||||
"stop_serve": self.stop_serve,
|
||||
"get_object_info": self.get_object_info,
|
||||
"find_location": self.find_location
|
||||
# "find_location": self.find_location,
|
||||
"get_number_of_objects": self.get_number_of_objects,
|
||||
}
|
||||
|
||||
def _update(self) -> ptree.common.Status:
|
||||
|
@ -63,6 +72,12 @@ class DealChat(Act):
|
|||
return ptree.common.Status.RUNNING
|
||||
|
||||
|
||||
def obj_name_en2zh(self,obj):
|
||||
obj = obj.replace("_", " ")
|
||||
obj = translator.translate(obj) #转成中文
|
||||
print("====obj:=======",obj)
|
||||
return obj
|
||||
|
||||
def create_sub_task(self, **args):
|
||||
try:
|
||||
goal = args['goal']
|
||||
|
@ -84,76 +99,179 @@ class DealChat(Act):
|
|||
def get_object_info(self,**args):
|
||||
try:
|
||||
obj = args['obj']
|
||||
|
||||
self.function_success = True
|
||||
except:
|
||||
obj = None
|
||||
print("参数解析错误")
|
||||
|
||||
|
||||
d = {"保温杯": "二号桌子"}
|
||||
if obj in d.keys():
|
||||
result = d[obj]
|
||||
else:
|
||||
result = "None"
|
||||
result = "没有"
|
||||
return result
|
||||
|
||||
# max_similarity = 0.02
|
||||
# similar_word = None
|
||||
|
||||
# 先把 obj 转成中文
|
||||
|
||||
# 写死的内容
|
||||
if obj in d.keys():
|
||||
near_object = d[obj]
|
||||
near_object = f"{obj}在{near_object}附近"
|
||||
obj_id = 0
|
||||
else: # 根据相似性查找物品位置
|
||||
obj = self.obj_name_en2zh(obj)
|
||||
|
||||
max_similarity = 0.02
|
||||
similar_word = None
|
||||
|
||||
# 场景中现有物品
|
||||
cur_things = set()
|
||||
for item in self.scene.status.objects:
|
||||
cur_things.add(self.scene.objname_en2zh_dic[item.name])
|
||||
# obj与现有物品进行相似度匹配 中文的匹配
|
||||
print("==========obj==========:",obj)
|
||||
query_token = nlp_zh(obj)
|
||||
for w in cur_things:
|
||||
word_token = nlp_zh(w)
|
||||
similarity = query_token.similarity(word_token)
|
||||
print("similarity:", similarity, w)
|
||||
if similarity > max_similarity:
|
||||
max_similarity = similarity
|
||||
similar_word = w
|
||||
if similar_word:
|
||||
print("max_similarity:",max_similarity,"similar_word:",similar_word)
|
||||
|
||||
if similar_word: # 存在同义词说明场景中存在该物品
|
||||
# near_object = random.choices(list(cur_things), k=5) # 返回场景中的5个物品
|
||||
# 找到距离最近的物品
|
||||
similar_word_en = self.scene.objname_zh2en_dic[similar_word]
|
||||
obj_dict = self.scene.status.objects
|
||||
if len(obj_dict)!=0:
|
||||
|
||||
for id, obji in enumerate(obj_dict):
|
||||
if obji.name == similar_word_en:
|
||||
obj_info = obj_dict[id]
|
||||
objx,objy,objz = obj_info.location.X, obj_info.location.Y, obj_info.location.Z
|
||||
break
|
||||
|
||||
# 获取离它最近的物品
|
||||
# min_dis = float('inf')
|
||||
# obj_id = -1
|
||||
# near_object = None
|
||||
# for id,obji in enumerate(obj_dict):
|
||||
# if obji.name != similar_word_en:
|
||||
# obj_info = obj_dict[id]
|
||||
# dis = self.scene.getDistanc3D((obj_info.location.X, obj_info.location.Y, obj_info.location.Z),(objx,objy,objz))
|
||||
# if dis<min_dis:
|
||||
# min_dis = dis
|
||||
# obj_id = id
|
||||
# near_object = obji.name
|
||||
#
|
||||
# near_object = f"{obj}在{self.scene.objname_en2zh_dic[near_object]}附近"
|
||||
|
||||
# 直接输出在哪个桌子上
|
||||
min_dis = float('inf')
|
||||
table_name = -1
|
||||
near_object = None
|
||||
for key,values in self.place_have_obj_xyz_dic.items():
|
||||
dis = self.scene.getDistanc3D(values,(objx, objy, objz))
|
||||
if dis<min_dis:
|
||||
min_dis = dis
|
||||
table_name = key
|
||||
# near_object = f"{obj}在{self.place_en2zh_name[table_name]}附近"
|
||||
# near_object = self.place_en2zh_name[table_name]
|
||||
near_object = obj + "在" + self.place_en2zh_name[table_name] +"附近"
|
||||
# near_object = self.place_en2zh_name[table_name]
|
||||
# near_object = "在" + self.place_en2zh_name[table_name] + "附近"
|
||||
return near_object
|
||||
|
||||
|
||||
|
||||
|
||||
# def find_location(self, **args):
|
||||
# try:
|
||||
# location = args['obj']
|
||||
# self.function_success = True
|
||||
# except:
|
||||
# obj = None
|
||||
# print("参数解析错误")
|
||||
#
|
||||
# # 场景中现有物品
|
||||
# cur_things = set()
|
||||
# for item in self.scene.status.objects:
|
||||
# cur_things.add(item.name)
|
||||
# # obj与现有物品进行相似度匹配
|
||||
# query_token = nlp(obj)
|
||||
# for w in cur_things:
|
||||
# d = {"保温杯": "二号桌子"}
|
||||
# if location in d.keys():
|
||||
# result = d[obj]
|
||||
# else:
|
||||
# result = "None"
|
||||
# return result
|
||||
# # 用户咨询的地点
|
||||
# query_token = nlp(location)
|
||||
# max_similarity = 0
|
||||
# similar_word = None
|
||||
# # 到自己维护的地点列表中找同义词
|
||||
# for w in self.scene.all_loc_en:
|
||||
# word_token = nlp(w)
|
||||
# similarity = query_token.similarity(word_token)
|
||||
# if similarity > max_similarity:
|
||||
# max_similarity = similarity
|
||||
# similar_word = w
|
||||
# print("similarity:", max_similarity, "similar_word:", similar_word)
|
||||
# # 存在同义词说明客户咨询的地点有效
|
||||
# if similar_word:
|
||||
# print("max_similarity:",max_similarity,"similar_word:",similar_word)
|
||||
#
|
||||
# if similar_word: # 存在同义词说明场景中存在该物品
|
||||
# near_object = random.choices(list(cur_things), k=5) # 返回场景中的5个物品
|
||||
#
|
||||
# if obj == "洗手间":
|
||||
# near_object = "Door"
|
||||
#
|
||||
# return near_object
|
||||
#
|
||||
def find_location(self, **args):
|
||||
# mp = list(self.scene.loc_map_en[similar_word])
|
||||
# near_location = random.choice(mp)
|
||||
# return near_location
|
||||
|
||||
def get_number_of_objects(self,**args):
|
||||
try:
|
||||
location = args['obj']
|
||||
obj = args['obj']
|
||||
self.function_success = True
|
||||
obj = self.obj_name_en2zh(obj)
|
||||
except:
|
||||
obj = None
|
||||
print("参数解析错误")
|
||||
|
||||
d = {"保温杯": "二号桌子"}
|
||||
if location in d.keys():
|
||||
result = d[obj]
|
||||
# 找到最近的中文
|
||||
max_similarity = 0.02
|
||||
similar_word = None
|
||||
|
||||
# obj 是中文
|
||||
# obj = translator.translate(obj) #转成中文
|
||||
# print("obj:",obj)
|
||||
query_token = nlp_zh(obj)
|
||||
for real_obj_name in self.scene.objname_zh2en_dic.keys(): # 在中文名字里面找
|
||||
word_token = nlp_zh(real_obj_name)
|
||||
similarity = query_token.similarity(word_token)
|
||||
# print("similarity:",similarity,real_obj_name)
|
||||
if similarity > max_similarity:
|
||||
max_similarity = similarity
|
||||
similar_word = real_obj_name
|
||||
if similar_word:
|
||||
print("max_similarity:",max_similarity,"similar_word:",similar_word)
|
||||
|
||||
count = 0
|
||||
similar_word_en = self.scene.objname_zh2en_dic[similar_word]
|
||||
if similar_word_en != "Customer":
|
||||
for item in self.scene.status.objects:
|
||||
if item.name == similar_word_en:
|
||||
count+=1
|
||||
else:
|
||||
result = "None"
|
||||
return result
|
||||
# 用户咨询的地点
|
||||
# query_token = nlp(location)
|
||||
# max_similarity = 0
|
||||
# similar_word = None
|
||||
# # 到自己维护的地点列表中找同义词
|
||||
# for w in self.scene.all_loc_en:
|
||||
# word_token = nlp(w)
|
||||
count = len(self.scene.status.walkers)
|
||||
|
||||
# obj 是英文
|
||||
# query_token = nlp(obj)
|
||||
# for real_obj_name in self.scene.objname_en2zh_dic.keys(): # 在中文名字里面找
|
||||
# word_token = nlp(real_obj_name)
|
||||
# similarity = query_token.similarity(word_token)
|
||||
# print("similarity:",similarity,real_obj_name)
|
||||
# if similarity > max_similarity:
|
||||
# max_similarity = similarity
|
||||
# similar_word = w
|
||||
# print("similarity:", max_similarity, "similar_word:", similar_word)
|
||||
# # 存在同义词说明客户咨询的地点有效
|
||||
# similar_word = real_obj_name
|
||||
# if similar_word:
|
||||
# mp = list(self.scene.loc_map_en[similar_word])
|
||||
# near_location = random.choice(mp)
|
||||
# return near_location
|
||||
# print("max_similarity:",max_similarity,"similar_word:",similar_word)
|
||||
return count
|
||||
|
||||
|
||||
|
||||
def stop_serve(self,**args):
|
||||
customer = self.scene.state["attention"]["customer"]
|
||||
|
|
|
@ -1,140 +0,0 @@
|
|||
import py_trees as ptree
|
||||
from robowaiter.behavior_lib._base.Act import Act
|
||||
|
||||
from robowaiter.llm_client.multi_rounds import ask_llm, new_history
|
||||
import random
|
||||
|
||||
|
||||
|
||||
class DealChatNLP(Act):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.chat_history = ""
|
||||
self.function_success = False
|
||||
self.func_map = {
|
||||
"create_sub_task": self.create_sub_task,
|
||||
"stop_serve": self.stop_serve,
|
||||
"get_object_info": self.get_object_info,
|
||||
"find_location": self.find_location
|
||||
}
|
||||
|
||||
def _update(self) -> ptree.common.Status:
|
||||
# if self.scene.status?
|
||||
name, sentence = self.scene.state['chat_list'].pop(0)
|
||||
|
||||
if name == "Goal":
|
||||
self.create_sub_task(goal=sentence)
|
||||
return ptree.common.Status.RUNNING
|
||||
|
||||
if name not in self.scene.state["chat_history"]:
|
||||
self.scene.state["chat_history"][name] = new_history()
|
||||
|
||||
history = self.scene.state["chat_history"][name]
|
||||
self.scene.state["attention"]["customer"] = name
|
||||
self.scene.state["serve_state"] = {
|
||||
"last_chat_time": self.scene.time,
|
||||
}
|
||||
|
||||
function_call, response = ask_llm(sentence,history,func_map=self.func_map)
|
||||
|
||||
|
||||
self.scene.chat_bubble(response) # 机器人输出对话
|
||||
|
||||
return ptree.common.Status.RUNNING
|
||||
|
||||
|
||||
def create_sub_task(self, **args):
|
||||
try:
|
||||
goal = args['goal']
|
||||
|
||||
w = goal.split(")")
|
||||
goal_set = set()
|
||||
goal_set.add(w[0] + ")")
|
||||
if len(w) > 1:
|
||||
for x in w[1:]:
|
||||
if x != "":
|
||||
goal_set.add(x[1:] + ")")
|
||||
self.function_success = True
|
||||
except:
|
||||
print("参数解析错误")
|
||||
|
||||
self.scene.robot.expand_sub_task_tree(goal_set)
|
||||
|
||||
def get_object_info(self,**args):
|
||||
|
||||
import spacy
|
||||
nlp = spacy.load('en_core_web_lg')
|
||||
|
||||
try:
|
||||
obj = args['obj']
|
||||
|
||||
self.function_success = True
|
||||
except:
|
||||
obj = None
|
||||
print("参数解析错误")
|
||||
|
||||
near_object = "None"
|
||||
|
||||
max_similarity = 0.02
|
||||
similar_word = None
|
||||
|
||||
# 场景中现有物品
|
||||
cur_things = set()
|
||||
for item in self.scene.status.objects:
|
||||
cur_things.add(item.name)
|
||||
# obj与现有物品进行相似度匹配
|
||||
query_token = nlp(obj)
|
||||
for w in cur_things:
|
||||
word_token = nlp(w)
|
||||
similarity = query_token.similarity(word_token)
|
||||
if similarity > max_similarity:
|
||||
max_similarity = similarity
|
||||
similar_word = w
|
||||
if similar_word:
|
||||
print("max_similarity:",max_similarity,"similar_word:",similar_word)
|
||||
|
||||
if similar_word: # 存在同义词说明场景中存在该物品
|
||||
near_object = random.choices(list(cur_things), k=5) # 返回场景中的5个物品
|
||||
|
||||
if obj == "洗手间":
|
||||
near_object = "Door"
|
||||
|
||||
return near_object
|
||||
|
||||
def find_location(self, **args):
|
||||
|
||||
import spacy
|
||||
nlp = spacy.load('en_core_web_lg')
|
||||
|
||||
try:
|
||||
location = args['obj']
|
||||
self.function_success = True
|
||||
except:
|
||||
obj = None
|
||||
print("参数解析错误")
|
||||
|
||||
near_location = None
|
||||
# 用户咨询的地点
|
||||
query_token = nlp(location)
|
||||
max_similarity = 0
|
||||
similar_word = None
|
||||
# 到自己维护的地点列表中找同义词
|
||||
for w in self.scene.all_loc_en:
|
||||
word_token = nlp(w)
|
||||
similarity = query_token.similarity(word_token)
|
||||
if similarity > max_similarity:
|
||||
max_similarity = similarity
|
||||
similar_word = w
|
||||
print("similarity:", max_similarity, "similar_word:", similar_word)
|
||||
# 存在同义词说明客户咨询的地点有效
|
||||
if similar_word:
|
||||
mp = list(self.scene.loc_map_en[similar_word])
|
||||
near_location = random.choice(mp)
|
||||
return near_location
|
||||
|
||||
def stop_serve(self,**args):
|
||||
|
||||
|
||||
return "好的"
|
||||
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
At(Robot,Bar) 请问您需要什么帮助吗?我就在吧台附近,能否请您自己过来呢?
|
||||
At(Robot,Bar) 请问你能去一下吧台吗?
|
||||
At(Robot,Bar) 请问你能帮我到吧台那个位置吗?
|
||||
At(Robot,WaterTable) 请问你能过来一下吗?我正在茶水桌旁。
|
||||
At(Robot,WaterTable) 请问你可以去茶水桌一下吗?
|
||||
At(Robot,WaterTable) 你能带路去茶水桌吗?
|
||||
At(Robot,CoffeeTable) 请问你可以过来一下吗?我在这张咖啡桌旁边。
|
||||
At(Robot,CoffeeTable) 请问你可以帮我一下,去一下咖啡桌吗?
|
||||
At(Robot,CoffeeTable) 请问你能帮我前往咖啡桌那个位置吗?
|
||||
At(Robot,Bar2) 您好,请问您需要什么帮助吗?我正在另一个吧台处理一些事情。
|
||||
At(Robot,Bar2) 请问你可以去一下另一个吧台吗?
|
||||
At(Robot,Bar2) 你能去另一个吧台的位置吗?
|
||||
At(Robot,Table1) 请问你能过来一下吗?我目前在第一桌,需要你的帮助。
|
||||
At(Robot,Table1) 请问你能去一下第一桌吗?
|
||||
At(Robot,Table1) 请问你能帮我到第一张桌子那个位置吗?
|
||||
At(Robot,Table2) 请问您能过来一下吗?我正在第二张桌子这里。
|
||||
At(Robot,Table2) 请问你可以去第二张桌子一下吗?
|
||||
At(Robot,Table2) 请问你能帮我前往第二桌吗?
|
||||
At(Robot,Table3) 请问你能过来一下吗?我正在第三张桌子旁。
|
||||
At(Robot,Table3) 请问你能去第三张桌子一下吗?
|
||||
At(Robot,Table3) 你能告诉我第三张桌子的位置在哪里吗?
|
||||
On(Softdrink,Bar) 您好,请问您需要我帮您把盒装冰红茶放到哪个位置呢?
|
||||
On(Softdrink,Bar) 服务员,能否帮我拿来一盒冰红茶放到吧台呢?
|
||||
On(Softdrink,WaterTable) 您好,请问您需要我帮忙将盒装冰红茶放到哪个位置吗?
|
||||
On(Softdrink,WaterTable) 服务员,能否帮我把盒装冰红茶拿到茶水桌呢?
|
||||
On(Softdrink,CoffeeTable) 请问你能把盒装冰红茶放到咖啡桌那个位置吗?
|
||||
On(Softdrink,CoffeeTable) 服务员,把盒装冰红茶拿到咖啡桌 position 好吗?
|
||||
On(Softdrink,Bar2) 请问你能把盒装冰红茶放到另一个吧台的位置吗?
|
||||
On(Softdrink,Bar2) 请问你能把盒装冰红茶拿到另一个吧台位置吗?
|
||||
On(Softdrink,Table1) 请问您能否把盒装冰红茶放在第一桌的指定位置呢?
|
||||
On(Softdrink,Table1) 请您把盒装冰红茶拿到第一桌的位置。
|
||||
On(Softdrink,Table2) 服务员,您好,请问能否帮我將這盒裝冰红茶放 到第二張桌子那個位置呢?
|
||||
On(Softdrink,Table2) 服务员,请把盒装冰红茶拿到第二张桌子的位置。
|
||||
On(Softdrink,Table3) 请问你可以把盒装冰红茶放到第三张桌子的那个位置吗?
|
||||
On(Softdrink,Table3) 请问你能把盒装冰红茶拿到第三张桌子的位置吗?
|
||||
On(BottledDrink,Bar) 您好,请问您需要我将瓶装饮料放到哪个位置呢?
|
||||
On(BottledDrink,Bar) 请把瓶装饮料拿到吧台的位置。
|
||||
On(BottledDrink,WaterTable) 请问你可以把瓶装饮料放到茶水桌那个位置吗?
|
||||
On(BottledDrink,WaterTable) 请问你能把瓶装饮料拿到茶水桌位置吗?
|
||||
On(BottledDrink,CoffeeTable) 服务员,能否把瓶装饮料放在咖啡桌那个位置呢?
|
||||
On(BottledDrink,CoffeeTable) 服务员,能否把瓶装饮料拿到咖啡桌附近呢?
|
||||
On(BottledDrink,Bar2) 请问你能把瓶装饮料放到另一个吧台的那个位置吗?
|
||||
On(BottledDrink,Bar2) 请把瓶装饮料拿到另一个吧台位置。
|
||||
On(BottledDrink,Table1) 请问您能否帮我將瓶裝飲料放至第一張桌子的那個位置呢?
|
||||
On(BottledDrink,Table1) 请问你能把瓶装饮料拿到第一桌的位置吗?
|
||||
On(BottledDrink,Table2) 请问,你可以把瓶装饮料放到第二张桌子的那个位置吗?
|
||||
On(BottledDrink,Table2) 请问你能把瓶装饮料拿到第二张桌子的位置吗?
|
||||
On(BottledDrink,Table3) 请问,你能把瓶装饮料放到第三桌的哪个位置吗?
|
||||
On(BottledDrink,Table3) 请问你能把瓶装饮料拿到第三张桌子的位置吗?
|
||||
On(Yogurt,Bar) 请问你能把酸奶放到吧台那个位置吗?
|
||||
On(Yogurt,Bar) 请问你能把酸奶拿到吧台位置吗?
|
||||
On(Yogurt,WaterTable) 请问你能把酸奶放到茶水桌那个位置吗?
|
||||
On(Yogurt,WaterTable) 服务员,请把酸奶拿到茶水桌的位置。
|
||||
On(Yogurt,CoffeeTable) 请问,你能把酸奶放在咖啡桌那个位置吗?
|
||||
On(Yogurt,CoffeeTable) 服务员,能否把酸奶拿到咖啡桌的位置呢?
|
||||
On(Yogurt,Bar2) 请问你能把酸奶放到另一个吧台的那个位置吗?
|
||||
On(Yogurt,Bar2) 请问你能把酸奶拿到另一个吧台位置吗?
|
|
@ -1,6 +1,8 @@
|
|||
import os
|
||||
import requests
|
||||
import urllib3
|
||||
from tqdm import tqdm
|
||||
|
||||
########################################
|
||||
# 该文件实现了与大模型的简单通信
|
||||
########################################
|
||||
|
@ -9,23 +11,28 @@ import urllib3
|
|||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
|
||||
def single_round(question,prefix=""):
|
||||
def single_round(question, prefix=""):
|
||||
url = "https://45.125.46.134:25344/v1/chat/completions"
|
||||
headers = {"Content-Type": "application/json"}
|
||||
data = {
|
||||
"model": "RoboWaiter",
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
# "content": "你是一个机器人服务员:RoboWaiter. 你的职责是为顾客提供对话及具身服务。"
|
||||
"content": "请将以下你对咖啡厅服务员说的话改写成更清晰更合理的顾客表述。"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": prefix + question
|
||||
}
|
||||
{
|
||||
"role": "system",
|
||||
# "content": "你是一个机器人服务员:RoboWaiter. 你的职责是为顾客提供对话及具身服务。"
|
||||
"content": """
|
||||
假设现在你是咖啡厅的一个顾客,请将以下你对咖啡厅服务员说的话改写成更清晰更合理的顾客表述。注意:句中的你指的是咖啡厅服务员,也不要说能帮我。
|
||||
例如:麻烦你去一下吧台。可以转述成:服务员,你能去下吧台吗?
|
||||
另一个例子:请你拿一下酸奶到吧台位置。可以转述成:服务员,拿一杯酸奶来吧台。
|
||||
|
||||
"""
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": prefix + question
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
response = requests.post(url, headers=headers, json=data, verify=False)
|
||||
|
||||
|
@ -37,14 +44,18 @@ def single_round(question,prefix=""):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
with open('goal_states_with_description.txt', 'r', encoding='utf-8') as file:
|
||||
with open('./goal_states_with_description.txt', 'r', encoding='utf-8') as file:
|
||||
lines = file.readlines()
|
||||
for line in lines:
|
||||
|
||||
output_file = './expansion_out/output2.txt'
|
||||
with open(output_file, 'a', encoding='utf-8') as file:
|
||||
file.truncate(0)
|
||||
for line in tqdm(lines):
|
||||
tmp = line[:-1].split('\t')
|
||||
#file.write("""{"title":"%s","text":"%s"}\n""" % (tmp[1], tmp[0]))
|
||||
# file.write("""{"title":"%s","text":"%s"}\n""" % (tmp[1], tmp[0]))
|
||||
question = tmp[1]
|
||||
#print(single_round(question))
|
||||
#print(tmp[1])
|
||||
with open('output1.txt', 'a',encoding='utf-8') as file:
|
||||
file.write(tmp[0]+"\t"+single_round(question)+'\n')
|
||||
# print(single_round(question))
|
||||
# print(tmp[1])
|
||||
with open(output_file, 'a', encoding='utf-8') as file:
|
||||
file.write(tmp[0] + "\t" + single_round(question, prefix="现在改写一下句子:") + '\n')
|
||||
print("输出完成")
|
|
@ -1,10 +1,8 @@
|
|||
import json
|
||||
import time
|
||||
|
||||
import openai
|
||||
from colorama import init, Fore
|
||||
from loguru import logger
|
||||
import json
|
||||
from robowaiter.llm_client.tool_register import get_tools, dispatch_tool
|
||||
import requests
|
||||
import json
|
||||
|
@ -92,7 +90,7 @@ def get_response(sentence, history, allow_function_call = True):
|
|||
|
||||
if sentence in fix_questions_dict:
|
||||
time.sleep(2)
|
||||
return parse_fix_question(sentence)
|
||||
return True, parse_fix_question(sentence)
|
||||
|
||||
params = dict(model="RoboWaiter")
|
||||
params['messages'] = role_system + list(history)
|
||||
|
@ -102,7 +100,7 @@ def get_response(sentence, history, allow_function_call = True):
|
|||
|
||||
response = requests.post(f"{base_url}/v1/chat/completions", json=params, stream=False, verify=False)
|
||||
decoded_line = response.json()
|
||||
return decoded_line
|
||||
return False, decoded_line
|
||||
|
||||
def deal_response(response, history, func_map=None ):
|
||||
if response["choices"][0]["message"].get("function_call"):
|
||||
|
@ -145,7 +143,7 @@ def deal_response(response, history, func_map=None ):
|
|||
|
||||
|
||||
def ask_llm(question,history, func_map=None, retry=3):
|
||||
response = get_response(question, history)
|
||||
fixed, response = get_response(question, history)
|
||||
|
||||
function_call,result = deal_response(response, history, func_map)
|
||||
if function_call:
|
||||
|
@ -163,7 +161,7 @@ def ask_llm(question,history, func_map=None, retry=3):
|
|||
history.append(message)
|
||||
|
||||
else:
|
||||
response = get_response(None, history,allow_function_call=False)
|
||||
fixed, response = get_response(None, history,allow_function_call=False)
|
||||
_,result = deal_response(response, history, func_map)
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,181 @@
|
|||
import time
|
||||
|
||||
import openai
|
||||
from colorama import init, Fore
|
||||
from loguru import logger
|
||||
from robowaiter.llm_client.tool_register import get_tools, dispatch_tool
|
||||
import requests
|
||||
import json
|
||||
from collections import deque
|
||||
|
||||
import urllib3
|
||||
import copy
|
||||
init(autoreset=True)
|
||||
from robowaiter.utils import get_root_path
|
||||
import os
|
||||
import re
|
||||
from robowaiter.llm_client.single_round import single_round
|
||||
from robowaiter.algos.retrieval.retrieval_lm.retrieval import Retrieval
|
||||
########################################
|
||||
# 该文件实现了与大模型的通信以及工具调用
|
||||
########################################
|
||||
|
||||
# 忽略https的安全性警告
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
base_url = "https://45.125.46.134:25344" # 本地部署的地址,或者使用你访问模型的API地址
|
||||
|
||||
root_path = get_root_path()
|
||||
# load test questions
|
||||
# file_path = os.path.join(root_path,"robowaiter/llm_client/data/fix_questions.txt")
|
||||
#
|
||||
# fix_questions_dict = {}
|
||||
# no_reply_functions = ["create_sub_task"]
|
||||
#
|
||||
|
||||
|
||||
functions = get_tools()
|
||||
retrieval = Retrieval(threshold=1.8)
|
||||
|
||||
|
||||
role_system = [{
|
||||
"role": "system",
|
||||
"content": "你是RoboWaiter,一个由HPCL团队开发的机器人服务员,你在咖啡厅工作。接受顾客的指令并调用工具函数来完成各种服务任务。如果顾客问你们这里有什么,或者想要点单,你说我们咖啡厅提供咖啡,水,点心,酸奶等食物。如果顾客不需要你了,你就回到吧台招待。如果顾客叫你去做某事,你回复:好的,我马上去做这件事。",
|
||||
}]
|
||||
|
||||
def new_history(max_length=7):
|
||||
history = deque(maxlen=max_length)
|
||||
|
||||
return history
|
||||
|
||||
def new_response():
|
||||
return {'choices': [{'index': 0, 'message':{} }]}
|
||||
|
||||
def parse_fix_question(question):
|
||||
response = new_response()
|
||||
fix_ans = question
|
||||
if not fix_ans['function']: #简单对话
|
||||
message = {'role': 'assistant', 'content': fix_ans["answer"], 'name': None,
|
||||
'function_call': None}
|
||||
else:
|
||||
func = fix_ans["function"]
|
||||
args = fix_ans["args"]
|
||||
# tool_response = dispatch_tool(function_call["name"], json.loads(args))
|
||||
# logger.info(f"Tool Call Response: {tool_response}")
|
||||
message = {'role': 'assistant',
|
||||
'content': f"\n <|assistant|> {func}({args})\n ```python\ntool_call(goal={args})\n```",
|
||||
'name': None,
|
||||
'function_call': {'name': func, 'arguments': args}}
|
||||
|
||||
response["choices"][0]["message"] = message
|
||||
return response, question["answer"]
|
||||
|
||||
def get_response(sentence, history, allow_function_call = True):
|
||||
if sentence:
|
||||
history.append({"role": "user", "content": sentence})
|
||||
|
||||
retrieval_result = retrieval.get_result(sentence)
|
||||
if retrieval_result is not None:
|
||||
time.sleep(1.2)
|
||||
# 处理多轮
|
||||
if retrieval_result["answer"] == "multi_rounds" and len(history) >= 2:
|
||||
print("触发多轮检索")
|
||||
last_content = ""
|
||||
for i in range(-2,-len(history)):
|
||||
if history[i]["role"] == "user":
|
||||
last_content = history[i]["content"]
|
||||
break
|
||||
retrieval_result = retrieval.get_result(last_content + sentence)
|
||||
if retrieval_result is not None:
|
||||
response, answer = parse_fix_question(retrieval_result)
|
||||
return True,response, answer
|
||||
|
||||
params = dict(model="RoboWaiter")
|
||||
params['messages'] = role_system + list(history)
|
||||
if allow_function_call:
|
||||
params["functions"] = functions
|
||||
|
||||
|
||||
response = requests.post(f"{base_url}/v1/chat/completions", json=params, stream=False, verify=False)
|
||||
decoded_line = response.json()
|
||||
return False, decoded_line, None
|
||||
|
||||
def deal_response(response, history, func_map=None ):
|
||||
if response["choices"][0]["message"].get("function_call"):
|
||||
function_call = response["choices"][0]["message"]["function_call"]
|
||||
logger.info(f"Function Call Response: {function_call}")
|
||||
|
||||
function_name = function_call["name"]
|
||||
function_args = json.loads(function_call["arguments"])
|
||||
if func_map:
|
||||
tool_response = func_map[function_name](**function_args)
|
||||
else:
|
||||
try:
|
||||
tool_response = dispatch_tool(function_call["name"], function_args)
|
||||
logger.info(f"Tool Call Response: {tool_response}")
|
||||
except:
|
||||
logger.info(f"重试工具调用")
|
||||
# tool_response = dispatch_tool(function_call["name"], function_args)
|
||||
return function_name,None
|
||||
|
||||
return_message = response["choices"][0]["message"]
|
||||
|
||||
history.append(return_message)
|
||||
t = {
|
||||
"role": "function",
|
||||
"name": function_call["name"],
|
||||
"content": str(tool_response), # 调用函数返回结果
|
||||
}
|
||||
|
||||
history.append(t)
|
||||
return function_call["name"], tool_response
|
||||
|
||||
else:
|
||||
return_message = response["choices"][0]["message"]
|
||||
reply = return_message["content"]
|
||||
|
||||
history.append(return_message)
|
||||
logger.info(f"Final Reply: \n{reply}")
|
||||
|
||||
return False, reply
|
||||
|
||||
|
||||
def ask_llm(question,history, func_map=None, retry=3):
|
||||
fixed, response, answer = get_response(question, history)
|
||||
|
||||
print(f"response: {response}")
|
||||
|
||||
function_call,result = deal_response(response, history, func_map)
|
||||
|
||||
if function_call:
|
||||
if fixed:
|
||||
if function_call == "create_sub_task":
|
||||
result = single_round(answer,
|
||||
"你是机器人服务员,请把以下句子换一种表述方式对顾客说,但是意思不变,尽量简短:\n")
|
||||
# elif function_call in ["get_object_info","find_location"] :
|
||||
else:
|
||||
result = single_round(f"你是机器人服务员,顾客想知道{question}, 你的具身场景查询返回的是{result},把返回的英文名词翻译成中文,请把按照以下句子对顾客说,{answer}, 尽量简短。\n")
|
||||
|
||||
message = {'role': 'assistant', 'content': result, 'name': None,
|
||||
'function_call': None}
|
||||
history.append(message)
|
||||
else:
|
||||
_,response,_ = get_response(None, history,allow_function_call=False)
|
||||
_,result = deal_response(response, history, func_map)
|
||||
|
||||
|
||||
print(f'{len(history)}条历史记录:')
|
||||
for x in history:
|
||||
print(x)
|
||||
return function_call, result
|
||||
|
||||
if __name__ == "__main__":
|
||||
question = input("\n顾客:")
|
||||
history = new_history()
|
||||
n = 1
|
||||
max_retry = 2
|
||||
|
||||
while question != 'end':
|
||||
function_call, return_message = ask_llm(question,history)
|
||||
|
||||
question = input("\n顾客:")
|
|
@ -233,6 +233,7 @@ def get_answer():
|
|||
answer = example["ctxs"][0]["text"]
|
||||
score = example["ctxs"][0]["score"]
|
||||
return score, answer
|
||||
|
||||
def retri(query):
|
||||
get_json(query)
|
||||
parser = argparse.ArgumentParser()
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import time
|
||||
|
||||
import requests
|
||||
import urllib3
|
||||
|
||||
########################################
|
||||
# 该文件实现了与大模型的简单通信
|
||||
########################################
|
||||
|
@ -9,22 +11,29 @@ import urllib3
|
|||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
|
||||
def single_round(question,prefix=""):
|
||||
def single_round(question, prefix=""):
|
||||
url = "https://45.125.46.134:25344/v1/chat/completions"
|
||||
headers = {"Content-Type": "application/json"}
|
||||
data = {
|
||||
"model": "RoboWaiter",
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "你是一个机器人服务员:RoboWaiter. 你的职责是为顾客提供对话及具身服务。"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": prefix + question
|
||||
}
|
||||
{
|
||||
"role": "system",
|
||||
"content": "你是一个机器人服务员:RoboWaiter. 你的职责是为顾客提供对话及具身服务。"
|
||||
# "content":
|
||||
# """
|
||||
# 你是一个熟悉行为树的工程师,你的职责是根据用户需求,为一个人型的机器人设计完成用户需求的行为树序列。
|
||||
# 行为树是一种有向根树,他的内部节点称为控制节点,控制节点包括选择、顺序,顺序节点只有所有子节点返回成功之后他才成功。
|
||||
# 选择节点只要有一个子节点返回成功最后就成功。叶节点称为执行节点,执行节点包括动作节点和条件节点。动作节点执行具体的动作,条件节点检查环境中的条件是否满足。
|
||||
# """
|
||||
# "content": "你是一个优秀的目标状态规划师,能够根据用户输入,规划出所需要的目标状态。例如:打开窗帘的目标状态可以是Is(Curtain, On)"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": prefix + question
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
response = requests.post(url, headers=headers, json=data, verify=False)
|
||||
|
||||
|
@ -37,7 +46,10 @@ def single_round(question,prefix=""):
|
|||
|
||||
if __name__ == '__main__':
|
||||
question = '''
|
||||
给我一杯拿铁
|
||||
嘿!能做一杯咖啡吗?咖啡就行!
|
||||
'''
|
||||
import timeit
|
||||
|
||||
print(single_round(question))
|
||||
cur_time = time.time()
|
||||
print(single_round(question, prefix='现在给出符合这句话要求的目标状态: '))
|
||||
print(f"单次生成耗时:{time.time() - cur_time} s \n")
|
||||
|
|
|
@ -160,14 +160,40 @@ def stop_serve(
|
|||
|
||||
@register_tool
|
||||
def get_object_info(
|
||||
obj: Annotated[str, '需要获取信息的物体名称', True]
|
||||
obj: Annotated[str, '需要获取位置的物体名称', True]
|
||||
) -> str:
|
||||
"""
|
||||
获取场景中指定物体 `object` 在哪里,不涉及到具体的执行任务
|
||||
如果`object` 是一个地点,例如洗手间,则输出大门。
|
||||
如果`object`是咖啡,则输出桌子,咖啡在桌子上。
|
||||
如果`object` 是空桌子,则输出一号桌
|
||||
获取场景中`object`的位置信息。在询问物品位置时调用该函数,以辅助场景交互,不执行动作
|
||||
例如:
|
||||
`object`在哪里?
|
||||
哪有`object`
|
||||
哪里有`object`?
|
||||
`object`在哪里
|
||||
哪里有`object`
|
||||
`object`放在哪里
|
||||
我在哪儿能找到`object`
|
||||
你们这儿有`object`吗?
|
||||
你们这里有`object`
|
||||
你看见`object`了吗?
|
||||
`object`在你们这里吗
|
||||
`object`,你看见过吗?
|
||||
遇到上述问题时,调用该函数,并根据返回的结果回复物体位置信息,例如
|
||||
回答:
|
||||
`object`在输出的物品附近
|
||||
如果`object` 是一个地点,例如洗手间,则输出大门。
|
||||
如果`object`是咖啡,输出桌子,则咖啡在桌子上。
|
||||
如果`object`是酸奶,输出冰红茶,则酸奶在冰红茶附近。
|
||||
如果`object` 是空桌子,则输出一号桌
|
||||
"""
|
||||
|
||||
# 桌上有
|
||||
# `object`
|
||||
# 吗?
|
||||
# 咖啡厅里哪里有
|
||||
# `object`
|
||||
# `object`
|
||||
# 放在哪里?
|
||||
|
||||
near_object = None
|
||||
# if obj == "Table":
|
||||
# near_object = "Bar"
|
||||
|
@ -192,22 +218,44 @@ def get_object_info(
|
|||
# 获取的location为英文
|
||||
# 用户想找某个地点
|
||||
# """
|
||||
# near_location = None
|
||||
# query_token = nlp(location)
|
||||
# max_similarity = 0
|
||||
# similar_word = None
|
||||
# for w in find_obj_utils.all_loc_en:
|
||||
# word_token = nlp(w)
|
||||
# similarity = query_token.similarity(word_token)
|
||||
#
|
||||
# if similarity > max_similarity:
|
||||
# max_similarity = similarity
|
||||
# similar_word = w
|
||||
# print("similarity:", max_similarity, "similar_word:", similar_word)
|
||||
# if similar_word:
|
||||
# mp = list(find_obj_utils.loc_map_en[similar_word])
|
||||
# near_location = random.choice(mp)
|
||||
# return near_location
|
||||
# near_location = None
|
||||
# query_token = nlp(location)
|
||||
# max_similarity = 0
|
||||
# similar_word = None
|
||||
# for w in find_obj_utils.all_loc_en:
|
||||
# word_token = nlp(w)
|
||||
# similarity = query_token.similarity(word_token)
|
||||
#
|
||||
# if similarity > max_similarity:
|
||||
# max_similarity = similarity
|
||||
# similar_word = w
|
||||
# print("similarity:", max_similarity, "similar_word:", similar_word)
|
||||
# if similar_word:
|
||||
# mp = list(find_obj_utils.loc_map_en[similar_word])
|
||||
# near_location = random.choice(mp)
|
||||
# return near_location
|
||||
|
||||
|
||||
@register_tool
|
||||
def get_number_of_objects(
|
||||
obj: Annotated[str, '需要获取数量的物体名称', True]
|
||||
) -> str:
|
||||
"""
|
||||
当询问场景中的物体数量时,需要调用这个工具。
|
||||
例如询问:
|
||||
`obj`有多少?
|
||||
有多少`obj`
|
||||
你们还有`obj`
|
||||
'桌子有几张'
|
||||
`obj`还有多的吗?
|
||||
`obj`有几个
|
||||
`obj`有多少个
|
||||
这个工具用于获取场景中指定物体 `obj` 的数量,返回一个整数,不涉及到具体的执行任务。
|
||||
如果`obj`是咖啡,如果场景中有5杯咖啡,就返回 5
|
||||
如果`obj`是桌子,如果场景中有7张桌子,就返回 7
|
||||
如果`obj`是行人,如果场景中有10个顾客,就返回 10
|
||||
"""
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(dispatch_tool("get_weather", {"city_name": "beijing"}))
|
||||
|
|
|
@ -0,0 +1,199 @@
|
|||
digraph pastafarianism {
|
||||
ordering=out;
|
||||
graph [fontname="times-roman"];
|
||||
node [fontname="times-roman"];
|
||||
edge [fontname="times-roman"];
|
||||
"a582faee-7147-4195-81ba-85add86624b4" [fillcolor=cyan, fontcolor=black, fontsize=20, height=0.01, label=Selector, shape=diamond, style=filled, width=0.01];
|
||||
"52d9dd56-2854-495c-820a-d4f291507f33" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"a582faee-7147-4195-81ba-85add86624b4" -> "52d9dd56-2854-495c-820a-d4f291507f33";
|
||||
"252a809b-7f62-49ae-addc-2191835a3544" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Chatting()", shape=ellipse, style=filled];
|
||||
"52d9dd56-2854-495c-820a-d4f291507f33" -> "252a809b-7f62-49ae-addc-2191835a3544";
|
||||
"39c31e0a-dd14-4477-a2e9-01754d4f25ca" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="DealChat()", shape=box, style=filled];
|
||||
"52d9dd56-2854-495c-820a-d4f291507f33" -> "39c31e0a-dd14-4477-a2e9-01754d4f25ca";
|
||||
"b938e131-cc32-4d66-a769-0b4539bbd4e9" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"a582faee-7147-4195-81ba-85add86624b4" -> "b938e131-cc32-4d66-a769-0b4539bbd4e9";
|
||||
"0e243f89-91ee-4b48-8a2b-a685f90589d3" [fillcolor=yellow, fontcolor=black, fontsize=20, label="HasSubTask()", shape=ellipse, style=filled];
|
||||
"b938e131-cc32-4d66-a769-0b4539bbd4e9" -> "0e243f89-91ee-4b48-8a2b-a685f90589d3";
|
||||
"38ed4e08-f4ae-4250-ad32-eff42d5ab471" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"b938e131-cc32-4d66-a769-0b4539bbd4e9" -> "38ed4e08-f4ae-4250-ad32-eff42d5ab471";
|
||||
"057834e6-77b3-416b-bebe-0e1690ea7b77" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"38ed4e08-f4ae-4250-ad32-eff42d5ab471" -> "057834e6-77b3-416b-bebe-0e1690ea7b77";
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" [fillcolor=cyan, fontcolor=black, fontsize=20, height=0.01, label=Selector, shape=diamond, style=filled, width=0.01];
|
||||
"057834e6-77b3-416b-bebe-0e1690ea7b77" -> "89809d74-1aa6-4401-b296-b10cb96a0017";
|
||||
"428ce8be-6e76-4032-865e-ed767f6d9cd9" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "428ce8be-6e76-4032-865e-ed767f6d9cd9";
|
||||
"416609ed-eb10-4d93-a8bf-389b30c8a489" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Coffee,WaterTable)", shape=ellipse, style=filled];
|
||||
"428ce8be-6e76-4032-865e-ed767f6d9cd9" -> "416609ed-eb10-4d93-a8bf-389b30c8a489";
|
||||
"4fc84dda-929f-42f0-b845-2caf0dd9de9b" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Water,WaterTable)", shape=ellipse, style=filled];
|
||||
"428ce8be-6e76-4032-865e-ed767f6d9cd9" -> "4fc84dda-929f-42f0-b845-2caf0dd9de9b";
|
||||
"8dbb1cc4-46f0-4a7f-bd41-bf4918faad0f" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "8dbb1cc4-46f0-4a7f-bd41-bf4918faad0f";
|
||||
"c4db186e-044d-4992-a6d0-dc0cf95aa3af" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Coffee,WaterTable)", shape=ellipse, style=filled];
|
||||
"8dbb1cc4-46f0-4a7f-bd41-bf4918faad0f" -> "c4db186e-044d-4992-a6d0-dc0cf95aa3af";
|
||||
"670d06c4-42a3-4e25-803f-43c8d6bc704c" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Nothing)", shape=ellipse, style=filled];
|
||||
"8dbb1cc4-46f0-4a7f-bd41-bf4918faad0f" -> "670d06c4-42a3-4e25-803f-43c8d6bc704c";
|
||||
"8ae61657-5b87-400a-b508-c99eac28f0b1" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="Make(Water)", shape=box, style=filled];
|
||||
"8dbb1cc4-46f0-4a7f-bd41-bf4918faad0f" -> "8ae61657-5b87-400a-b508-c99eac28f0b1";
|
||||
"499ad5e8-a924-45b2-8f9e-e376e12cc23f" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "499ad5e8-a924-45b2-8f9e-e376e12cc23f";
|
||||
"933d9099-d8cb-439a-a194-5ee422cccd64" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Coffee,WaterTable)", shape=ellipse, style=filled];
|
||||
"499ad5e8-a924-45b2-8f9e-e376e12cc23f" -> "933d9099-d8cb-439a-a194-5ee422cccd64";
|
||||
"1d582953-04bd-4d6e-b57e-cc516073a5f2" [fillcolor=yellow, fontcolor=black, fontsize=20, label="At(Robot,WaterTable)", shape=ellipse, style=filled];
|
||||
"499ad5e8-a924-45b2-8f9e-e376e12cc23f" -> "1d582953-04bd-4d6e-b57e-cc516073a5f2";
|
||||
"5da03831-1168-4a0b-b5c4-e1545eae332f" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Water)", shape=ellipse, style=filled];
|
||||
"499ad5e8-a924-45b2-8f9e-e376e12cc23f" -> "5da03831-1168-4a0b-b5c4-e1545eae332f";
|
||||
"41cde1a8-35f2-47ec-8eb9-04bd6f7c6879" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="PutDown(Water,WaterTable)", shape=box, style=filled];
|
||||
"499ad5e8-a924-45b2-8f9e-e376e12cc23f" -> "41cde1a8-35f2-47ec-8eb9-04bd6f7c6879";
|
||||
"508b6d47-b448-452f-bb2a-3d214c4b33ad" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "508b6d47-b448-452f-bb2a-3d214c4b33ad";
|
||||
"c1bb3e26-8883-42ea-b6c3-57b6b989609a" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Coffee)", shape=ellipse, style=filled];
|
||||
"508b6d47-b448-452f-bb2a-3d214c4b33ad" -> "c1bb3e26-8883-42ea-b6c3-57b6b989609a";
|
||||
"d92346dd-2191-41a5-9536-f82022404c75" [fillcolor=yellow, fontcolor=black, fontsize=20, label="At(Robot,WaterTable)", shape=ellipse, style=filled];
|
||||
"508b6d47-b448-452f-bb2a-3d214c4b33ad" -> "d92346dd-2191-41a5-9536-f82022404c75";
|
||||
"86966885-d2be-4e6e-9946-8cfe42a7220c" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Water,WaterTable)", shape=ellipse, style=filled];
|
||||
"508b6d47-b448-452f-bb2a-3d214c4b33ad" -> "86966885-d2be-4e6e-9946-8cfe42a7220c";
|
||||
"df497c9e-356b-4304-9fd0-921db828e93f" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="PutDown(Coffee,WaterTable)", shape=box, style=filled];
|
||||
"508b6d47-b448-452f-bb2a-3d214c4b33ad" -> "df497c9e-356b-4304-9fd0-921db828e93f";
|
||||
"1ccd2c59-53f0-42cb-ae43-54478ae1c64b" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "1ccd2c59-53f0-42cb-ae43-54478ae1c64b";
|
||||
"8342fd0e-0596-496c-9534-8770a064b59e" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Coffee,WaterTable)", shape=ellipse, style=filled];
|
||||
"1ccd2c59-53f0-42cb-ae43-54478ae1c64b" -> "8342fd0e-0596-496c-9534-8770a064b59e";
|
||||
"04e4b336-479a-4bb3-972d-f186a3d03759" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="FreeHands()", shape=box, style=filled];
|
||||
"1ccd2c59-53f0-42cb-ae43-54478ae1c64b" -> "04e4b336-479a-4bb3-972d-f186a3d03759";
|
||||
"55980925-a4d9-4fde-b08a-b2dcffbec659" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "55980925-a4d9-4fde-b08a-b2dcffbec659";
|
||||
"f246a574-4935-4646-a474-d866d7f8355b" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Coffee)", shape=ellipse, style=filled];
|
||||
"55980925-a4d9-4fde-b08a-b2dcffbec659" -> "f246a574-4935-4646-a474-d866d7f8355b";
|
||||
"d33b539f-f3ac-4934-b0d2-c538d3bde390" [fillcolor=yellow, fontcolor=black, fontsize=20, label="At(Robot,WaterTable)", shape=ellipse, style=filled];
|
||||
"55980925-a4d9-4fde-b08a-b2dcffbec659" -> "d33b539f-f3ac-4934-b0d2-c538d3bde390";
|
||||
"95c3881e-ad7c-4a6e-b758-683834718b67" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="PutDown(Coffee,WaterTable)", shape=box, style=filled];
|
||||
"55980925-a4d9-4fde-b08a-b2dcffbec659" -> "95c3881e-ad7c-4a6e-b758-683834718b67";
|
||||
"c9d033ba-b2a5-406f-8d7b-c644ee5e8a13" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "c9d033ba-b2a5-406f-8d7b-c644ee5e8a13";
|
||||
"8483c080-80c2-4f0d-9787-4a8ab035c8f7" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Coffee)", shape=ellipse, style=filled];
|
||||
"c9d033ba-b2a5-406f-8d7b-c644ee5e8a13" -> "8483c080-80c2-4f0d-9787-4a8ab035c8f7";
|
||||
"696baf79-2e67-4225-84f9-4db8cb5a7877" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Water,WaterTable)", shape=ellipse, style=filled];
|
||||
"c9d033ba-b2a5-406f-8d7b-c644ee5e8a13" -> "696baf79-2e67-4225-84f9-4db8cb5a7877";
|
||||
"71f49725-d34c-4990-8956-94b0d7076872" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="MoveTo(WaterTable)", shape=box, style=filled];
|
||||
"c9d033ba-b2a5-406f-8d7b-c644ee5e8a13" -> "71f49725-d34c-4990-8956-94b0d7076872";
|
||||
"ae1795ad-99ad-4a19-ae19-3dfac64b96d5" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "ae1795ad-99ad-4a19-ae19-3dfac64b96d5";
|
||||
"3f5584f5-98e4-4d97-ada4-518fd930efe1" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Coffee)", shape=ellipse, style=filled];
|
||||
"ae1795ad-99ad-4a19-ae19-3dfac64b96d5" -> "3f5584f5-98e4-4d97-ada4-518fd930efe1";
|
||||
"feb9d0bd-81ef-4de4-a011-554cfab12dfc" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="MoveTo(WaterTable)", shape=box, style=filled];
|
||||
"ae1795ad-99ad-4a19-ae19-3dfac64b96d5" -> "feb9d0bd-81ef-4de4-a011-554cfab12dfc";
|
||||
"0304536e-fa59-485d-a452-47a668dfe2ea" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "0304536e-fa59-485d-a452-47a668dfe2ea";
|
||||
"4a75fcc7-7c99-4d64-8150-add03da82ef7" [fillcolor=yellow, fontcolor=black, fontsize=20, label="At(Robot,Coffee)", shape=ellipse, style=filled];
|
||||
"0304536e-fa59-485d-a452-47a668dfe2ea" -> "4a75fcc7-7c99-4d64-8150-add03da82ef7";
|
||||
"911690ee-a827-4fde-9846-5f291ef0ff6e" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Nothing)", shape=ellipse, style=filled];
|
||||
"0304536e-fa59-485d-a452-47a668dfe2ea" -> "911690ee-a827-4fde-9846-5f291ef0ff6e";
|
||||
"c35cb7a2-15d2-4440-bbf8-7667b5711653" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Water,WaterTable)", shape=ellipse, style=filled];
|
||||
"0304536e-fa59-485d-a452-47a668dfe2ea" -> "c35cb7a2-15d2-4440-bbf8-7667b5711653";
|
||||
"7baadc46-e643-4db4-bbd7-d8f109ea6c06" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="PickUp(Coffee)", shape=box, style=filled];
|
||||
"0304536e-fa59-485d-a452-47a668dfe2ea" -> "7baadc46-e643-4db4-bbd7-d8f109ea6c06";
|
||||
"b7923c0f-0992-4266-868d-558efbd07716" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "b7923c0f-0992-4266-868d-558efbd07716";
|
||||
"d5c99c51-2edc-4d41-b2db-0068f92aa77c" [fillcolor=yellow, fontcolor=black, fontsize=20, label="At(Robot,Coffee)", shape=ellipse, style=filled];
|
||||
"b7923c0f-0992-4266-868d-558efbd07716" -> "d5c99c51-2edc-4d41-b2db-0068f92aa77c";
|
||||
"89129311-b249-4eab-83a7-c5cf21a35c00" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Nothing)", shape=ellipse, style=filled];
|
||||
"b7923c0f-0992-4266-868d-558efbd07716" -> "89129311-b249-4eab-83a7-c5cf21a35c00";
|
||||
"711d4b2e-0087-4520-9528-ad5b252aadd5" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="PickUp(Coffee)", shape=box, style=filled];
|
||||
"b7923c0f-0992-4266-868d-558efbd07716" -> "711d4b2e-0087-4520-9528-ad5b252aadd5";
|
||||
"6de54193-aa93-4d1a-b3f3-d04adb06a7ac" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "6de54193-aa93-4d1a-b3f3-d04adb06a7ac";
|
||||
"55153a6f-cb38-4bd1-8602-d6960b6bdbfa" [fillcolor=yellow, fontcolor=black, fontsize=20, label="At(Robot,Coffee)", shape=ellipse, style=filled];
|
||||
"6de54193-aa93-4d1a-b3f3-d04adb06a7ac" -> "55153a6f-cb38-4bd1-8602-d6960b6bdbfa";
|
||||
"88c8b174-727b-4249-8768-17630e6e37e0" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Water,WaterTable)", shape=ellipse, style=filled];
|
||||
"6de54193-aa93-4d1a-b3f3-d04adb06a7ac" -> "88c8b174-727b-4249-8768-17630e6e37e0";
|
||||
"c7f0187c-a4c8-4b76-8da1-4ac790e56ee5" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="FreeHands()", shape=box, style=filled];
|
||||
"6de54193-aa93-4d1a-b3f3-d04adb06a7ac" -> "c7f0187c-a4c8-4b76-8da1-4ac790e56ee5";
|
||||
"acc92740-05eb-4963-b01b-63b41cf20140" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "acc92740-05eb-4963-b01b-63b41cf20140";
|
||||
"5508c6dc-6c58-4d91-a2f7-81b19be0f22d" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Nothing)", shape=ellipse, style=filled];
|
||||
"acc92740-05eb-4963-b01b-63b41cf20140" -> "5508c6dc-6c58-4d91-a2f7-81b19be0f22d";
|
||||
"ed0d3415-95b4-4ce5-9341-b7352f78eff1" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Water,WaterTable)", shape=ellipse, style=filled];
|
||||
"acc92740-05eb-4963-b01b-63b41cf20140" -> "ed0d3415-95b4-4ce5-9341-b7352f78eff1";
|
||||
"248b5d9a-5160-4154-a747-35c180c26788" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Exist(Coffee)", shape=ellipse, style=filled];
|
||||
"acc92740-05eb-4963-b01b-63b41cf20140" -> "248b5d9a-5160-4154-a747-35c180c26788";
|
||||
"96ea24c5-198d-46ff-88e6-375a310463c2" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="MoveTo(Coffee)", shape=box, style=filled];
|
||||
"acc92740-05eb-4963-b01b-63b41cf20140" -> "96ea24c5-198d-46ff-88e6-375a310463c2";
|
||||
"370f4fa8-1789-47cf-86d4-43c1fcaec40d" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "370f4fa8-1789-47cf-86d4-43c1fcaec40d";
|
||||
"3b4e2601-a215-4c53-9725-024a7272ca01" [fillcolor=yellow, fontcolor=black, fontsize=20, label="At(Robot,Coffee)", shape=ellipse, style=filled];
|
||||
"370f4fa8-1789-47cf-86d4-43c1fcaec40d" -> "3b4e2601-a215-4c53-9725-024a7272ca01";
|
||||
"5207249d-7ed3-4374-8c35-551323aa6e6f" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="FreeHands()", shape=box, style=filled];
|
||||
"370f4fa8-1789-47cf-86d4-43c1fcaec40d" -> "5207249d-7ed3-4374-8c35-551323aa6e6f";
|
||||
"adb07734-f041-4c2e-9e4c-360fc7932ec9" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "adb07734-f041-4c2e-9e4c-360fc7932ec9";
|
||||
"c050928b-ea79-40c0-b9ba-fdf1cb60a773" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Nothing)", shape=ellipse, style=filled];
|
||||
"adb07734-f041-4c2e-9e4c-360fc7932ec9" -> "c050928b-ea79-40c0-b9ba-fdf1cb60a773";
|
||||
"07b147ab-23b5-48ae-9449-c810c93e28b4" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Exist(Coffee)", shape=ellipse, style=filled];
|
||||
"adb07734-f041-4c2e-9e4c-360fc7932ec9" -> "07b147ab-23b5-48ae-9449-c810c93e28b4";
|
||||
"59f2afe9-173b-41f8-921e-29cfd4ecc1c4" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="MoveTo(Coffee)", shape=box, style=filled];
|
||||
"adb07734-f041-4c2e-9e4c-360fc7932ec9" -> "59f2afe9-173b-41f8-921e-29cfd4ecc1c4";
|
||||
"fcbee6e1-0e5e-41c3-9db5-5bf808bac68b" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "fcbee6e1-0e5e-41c3-9db5-5bf808bac68b";
|
||||
"f0843e6c-a65a-4d9f-971d-06766e94df66" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Water,WaterTable)", shape=ellipse, style=filled];
|
||||
"fcbee6e1-0e5e-41c3-9db5-5bf808bac68b" -> "f0843e6c-a65a-4d9f-971d-06766e94df66";
|
||||
"6dab056a-a232-4212-af57-5c1c1465db99" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Exist(Coffee)", shape=ellipse, style=filled];
|
||||
"fcbee6e1-0e5e-41c3-9db5-5bf808bac68b" -> "6dab056a-a232-4212-af57-5c1c1465db99";
|
||||
"0c2f54f1-85e8-486d-9c81-3d18f5f12ae8" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="MoveTo(Coffee)", shape=box, style=filled];
|
||||
"fcbee6e1-0e5e-41c3-9db5-5bf808bac68b" -> "0c2f54f1-85e8-486d-9c81-3d18f5f12ae8";
|
||||
"1c873ce0-8037-40a0-9394-037257e6ef1f" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "1c873ce0-8037-40a0-9394-037257e6ef1f";
|
||||
"4c2f06f6-fa4b-41a2-a50d-cbd4f2370b5b" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Nothing)", shape=ellipse, style=filled];
|
||||
"1c873ce0-8037-40a0-9394-037257e6ef1f" -> "4c2f06f6-fa4b-41a2-a50d-cbd4f2370b5b";
|
||||
"e311ac9a-4505-442e-9ec9-47c2a0fd2ac8" [fillcolor=yellow, fontcolor=black, fontsize=20, label="On(Water,WaterTable)", shape=ellipse, style=filled];
|
||||
"1c873ce0-8037-40a0-9394-037257e6ef1f" -> "e311ac9a-4505-442e-9ec9-47c2a0fd2ac8";
|
||||
"b3880316-85f0-4124-a18a-fa84896d3485" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="Make(Coffee)", shape=box, style=filled];
|
||||
"1c873ce0-8037-40a0-9394-037257e6ef1f" -> "b3880316-85f0-4124-a18a-fa84896d3485";
|
||||
"96e46656-34ac-47aa-83b1-902ec66e53b5" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "96e46656-34ac-47aa-83b1-902ec66e53b5";
|
||||
"41ad97fa-7ea9-48e4-8cd3-187dc53fe992" [fillcolor=yellow, fontcolor=black, fontsize=20, label="At(Robot,WaterTable)", shape=ellipse, style=filled];
|
||||
"96e46656-34ac-47aa-83b1-902ec66e53b5" -> "41ad97fa-7ea9-48e4-8cd3-187dc53fe992";
|
||||
"7e7163b1-eadd-4f81-99c5-5cd238252a79" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Water)", shape=ellipse, style=filled];
|
||||
"96e46656-34ac-47aa-83b1-902ec66e53b5" -> "7e7163b1-eadd-4f81-99c5-5cd238252a79";
|
||||
"18b63af1-2803-4a7d-95c2-c701dff29a51" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Exist(Coffee)", shape=ellipse, style=filled];
|
||||
"96e46656-34ac-47aa-83b1-902ec66e53b5" -> "18b63af1-2803-4a7d-95c2-c701dff29a51";
|
||||
"1f492236-0a16-4e47-bca0-d6cda8fc1e79" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="PutDown(Water,WaterTable)", shape=box, style=filled];
|
||||
"96e46656-34ac-47aa-83b1-902ec66e53b5" -> "1f492236-0a16-4e47-bca0-d6cda8fc1e79";
|
||||
"26396b01-8762-46f0-be46-224b590173ce" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "26396b01-8762-46f0-be46-224b590173ce";
|
||||
"bee79c41-c84d-427a-a0b4-fe732ab6e448" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Exist(Coffee)", shape=ellipse, style=filled];
|
||||
"26396b01-8762-46f0-be46-224b590173ce" -> "bee79c41-c84d-427a-a0b4-fe732ab6e448";
|
||||
"7845d148-bef6-4b74-959b-5e13fbe75330" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="MoveTo(Coffee)", shape=box, style=filled];
|
||||
"26396b01-8762-46f0-be46-224b590173ce" -> "7845d148-bef6-4b74-959b-5e13fbe75330";
|
||||
"eee68ac0-f125-4074-a523-dcd9b1d25e42" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"89809d74-1aa6-4401-b296-b10cb96a0017" -> "eee68ac0-f125-4074-a523-dcd9b1d25e42";
|
||||
"bc97fe9a-8eeb-4d4f-8865-025bf8ab1d0e" [fillcolor=yellow, fontcolor=black, fontsize=20, label="Holding(Nothing)", shape=ellipse, style=filled];
|
||||
"eee68ac0-f125-4074-a523-dcd9b1d25e42" -> "bc97fe9a-8eeb-4d4f-8865-025bf8ab1d0e";
|
||||
"e631843b-92d8-4612-8dcf-7dd66b86a531" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="Make(Coffee)", shape=box, style=filled];
|
||||
"eee68ac0-f125-4074-a523-dcd9b1d25e42" -> "e631843b-92d8-4612-8dcf-7dd66b86a531";
|
||||
"1c7e5f57-89fe-40d3-a5fe-45d7fa2e7f90" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="DelSubTree()", shape=box, style=filled];
|
||||
"057834e6-77b3-416b-bebe-0e1690ea7b77" -> "1c7e5f57-89fe-40d3-a5fe-45d7fa2e7f90";
|
||||
"deb5f50b-93ac-4601-a5f1-af68f0f9d50a" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"a582faee-7147-4195-81ba-85add86624b4" -> "deb5f50b-93ac-4601-a5f1-af68f0f9d50a";
|
||||
"8d9e0427-c7c4-4c8a-b6a1-d3cf0a7ae4c6" [fillcolor=yellow, fontcolor=black, fontsize=20, label="FocusingCustomer()", shape=ellipse, style=filled];
|
||||
"deb5f50b-93ac-4601-a5f1-af68f0f9d50a" -> "8d9e0427-c7c4-4c8a-b6a1-d3cf0a7ae4c6";
|
||||
"a8ab831b-5e89-41c6-9a6a-15441aa1d32b" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="ServeCustomer()", shape=box, style=filled];
|
||||
"deb5f50b-93ac-4601-a5f1-af68f0f9d50a" -> "a8ab831b-5e89-41c6-9a6a-15441aa1d32b";
|
||||
"cc071d28-4cb6-4bbd-a866-38f48b77efda" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"a582faee-7147-4195-81ba-85add86624b4" -> "cc071d28-4cb6-4bbd-a866-38f48b77efda";
|
||||
"e227e659-1432-4fba-8b6a-a9364e51076c" [fillcolor=yellow, fontcolor=black, fontsize=20, label="NewCustomer()", shape=ellipse, style=filled];
|
||||
"cc071d28-4cb6-4bbd-a866-38f48b77efda" -> "e227e659-1432-4fba-8b6a-a9364e51076c";
|
||||
"d3a930dc-8300-4510-a83c-5f070170bb5b" [fillcolor=cyan, fontcolor=black, fontsize=20, height=0.01, label=Selector, shape=diamond, style=filled, width=0.01];
|
||||
"cc071d28-4cb6-4bbd-a866-38f48b77efda" -> "d3a930dc-8300-4510-a83c-5f070170bb5b";
|
||||
"85295be4-2eed-4dac-98f6-040450241204" [fillcolor=yellow, fontcolor=black, fontsize=20, label="At(Robot,Bar)", shape=ellipse, style=filled];
|
||||
"d3a930dc-8300-4510-a83c-5f070170bb5b" -> "85295be4-2eed-4dac-98f6-040450241204";
|
||||
"5a775c24-2a6b-445c-87e9-9eeab2b6882c" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="MoveTo(Bar)", shape=box, style=filled];
|
||||
"d3a930dc-8300-4510-a83c-5f070170bb5b" -> "5a775c24-2a6b-445c-87e9-9eeab2b6882c";
|
||||
"3b8f863e-eef0-43e9-8ccc-4086c59af2a1" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="GreetCustomer()", shape=box, style=filled];
|
||||
"cc071d28-4cb6-4bbd-a866-38f48b77efda" -> "3b8f863e-eef0-43e9-8ccc-4086c59af2a1";
|
||||
"16c9b1ee-9159-4816-92a4-37c149d0233a" [fillcolor=orange, fontcolor=black, fontsize=20, height=0.01, label=Sequence, shape=octagon, style=filled, width=0.01];
|
||||
"a582faee-7147-4195-81ba-85add86624b4" -> "16c9b1ee-9159-4816-92a4-37c149d0233a";
|
||||
"967d7a51-f3e2-4b8f-9331-dc75660d7136" [fillcolor=yellow, fontcolor=black, fontsize=20, label="AnomalyDetected()", shape=ellipse, style=filled];
|
||||
"16c9b1ee-9159-4816-92a4-37c149d0233a" -> "967d7a51-f3e2-4b8f-9331-dc75660d7136";
|
||||
"9b9909d3-e999-4706-b4de-1c60dfe53a14" [fillcolor=lawngreen, fontcolor=black, fontsize=20, label="ResolveAnomaly()", shape=box, style=filled];
|
||||
"16c9b1ee-9159-4816-92a4-37c149d0233a" -> "9b9909d3-e999-4706-b4de-1c60dfe53a14";
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 114 KiB |
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 88 KiB |
|
@ -16,7 +16,7 @@ from robowaiter.proto import GrabSim_pb2_grpc
|
|||
import copy
|
||||
import os
|
||||
|
||||
from robowaiter.scene.ui import scene_ui
|
||||
# from robowaiter.scene.ui import scene_ui
|
||||
from robowaiter.utils import get_root_path
|
||||
from sklearn.cluster import DBSCAN
|
||||
from matplotlib import pyplot as plt
|
||||
|
@ -39,7 +39,143 @@ channel = grpc.insecure_channel(
|
|||
animation_step = [4, 5, 7, 3, 3]
|
||||
loc_offset = [-700, -1400]
|
||||
|
||||
|
||||
objname_en2zh_dic_goal = {
|
||||
'Customer':'顾客',
|
||||
'Banana': '香蕉',
|
||||
'Toothpaste': '牙膏',
|
||||
'Bread': '面包',
|
||||
'Softdrink': '盒装饮料',
|
||||
'Yogurt': '酸奶',
|
||||
'ADMilk': '安佳牛奶',
|
||||
'VacuumCup': '真空杯',
|
||||
'Bernachon': '贝尔纳松',
|
||||
'BottledDrink': '瓶装饮料',
|
||||
'PencilVase': '铅笔花瓶',
|
||||
'Teacup': '茶杯',
|
||||
'Dictionary': '字典',
|
||||
'Cake': '蛋糕',
|
||||
'Stapler': '订书机',
|
||||
'LunchBox': '午餐盒',
|
||||
'Bracelet': '手镯',
|
||||
'CoconutWater': '椰水',
|
||||
'Walnut': '核桃',
|
||||
'HamSausage': '火腿肠',
|
||||
'GlueStick': '胶棒',
|
||||
'AdhesiveTape': '胶带',
|
||||
'Calculator': '计算器',
|
||||
'Chess': '棋',
|
||||
'Orange': '橙子',
|
||||
'Glass': '玻璃杯',
|
||||
'Washbowl': '洗碗盆',
|
||||
'Durian': '榴莲',
|
||||
'Gum': '口香糖',
|
||||
'Towel': '毛巾',
|
||||
'OrangeJuice': '橙汁',
|
||||
'Cardcase': '卡包',
|
||||
'RubikCube': '魔方',
|
||||
'StickyNotes': '便签',
|
||||
'NFCJuice': 'NFC果汁',
|
||||
'SpringWater': '矿泉水',
|
||||
'Apple': '苹果',
|
||||
'Coffee': '咖啡',
|
||||
'Gauze': '纱布',
|
||||
'Mangosteen': '山竹',
|
||||
'SesameSeedCake': '芝麻糕',
|
||||
'Glove': '手套',
|
||||
'Mouse': '鼠标',
|
||||
'Kettle': '水壶',
|
||||
'Atomize': '喷雾器',
|
||||
'Chips': '薯片',
|
||||
'SpongeGourd': '丝瓜',
|
||||
'Garlic': '大蒜',
|
||||
'Potato': '土豆',
|
||||
'Tray': '托盘',
|
||||
'Hemomanometer': '血压计',
|
||||
'TennisBall': '网球',
|
||||
'ToyDog': '玩具狗',
|
||||
'ToyBear': '玩具熊',
|
||||
'TeaTray': '茶盘',
|
||||
'Sock': '袜子',
|
||||
'Scarf': '围巾',
|
||||
'ToiletPaper': '卫生纸',
|
||||
'Milk': '牛奶',
|
||||
'Novel': '小说',
|
||||
'Watermelon': '西瓜',
|
||||
'Tomato': '番茄',
|
||||
'CleansingFoam': '洁面泡沫',
|
||||
'CoconutMilk': '椰奶',
|
||||
'SugarlessGum': '无糖口香糖',
|
||||
'MedicalAdhesiveTape': '医用胶带',
|
||||
'PaperCup': '纸杯',
|
||||
'Caddy': '茶匙',
|
||||
'Date': '日期',
|
||||
'MilkDrink': '牛奶饮品',
|
||||
'CocountWater': '椰水',
|
||||
'AdhensiveTape': '胶带',
|
||||
'Towl': '毛巾',
|
||||
'Soap': '肥皂',
|
||||
'CocountMilk': '椰奶',
|
||||
'MedicalAdhensiveTape': '医用胶带',
|
||||
'SourMilkDrink': '酸奶饮品',
|
||||
'Tissue': '纸巾',
|
||||
'YogurtDrink': '酸奶饮品',
|
||||
'Newspaper': '报纸',
|
||||
'Box': '盒子',
|
||||
'PaperCupStarbucks': '星巴克纸杯',
|
||||
'CoffeeMachine': '咖啡机',
|
||||
'GingerLHand': '机器人左手',
|
||||
'GingerRHand': '机器人右手',
|
||||
'Straw': '吸管',
|
||||
'Door': '门',
|
||||
'Machine': '机器',
|
||||
'PackagedCoffee': '包装咖啡',
|
||||
'CubeSugar': '方糖',
|
||||
'Spoon': '勺子',
|
||||
'Drinks': '饮料',
|
||||
'Drink': '饮料',
|
||||
'Take-AwayCup': '外带杯',
|
||||
'Saucer': '茶杯',
|
||||
'TrashBin': '垃圾桶',
|
||||
'Knife': '刀',
|
||||
'Ginger': '姜',
|
||||
'Floor': '地板',
|
||||
'Roof': '屋顶',
|
||||
'Wall': '墙',
|
||||
'Broom':'扫帚',
|
||||
'CoffeeCup': '咖啡杯',
|
||||
'Mug': '马克杯',
|
||||
'ZhuZi': '著子',
|
||||
'LaJiTong': '垃圾桶',
|
||||
'ZaoTai': '灶台',
|
||||
'Sofa': '沙发',
|
||||
'ChaTou': '插头',
|
||||
'Plate': '盘子',
|
||||
'CoffeeBag': '咖啡袋',
|
||||
'TuoBu': '拖布',
|
||||
'KaiGuan': '开关',
|
||||
'ChaZuo': '插座',
|
||||
'Sugar': '糖',
|
||||
'BaTai': '吧台',
|
||||
'BaoJing': '报警',
|
||||
'DrinkMachine': '饮料机',
|
||||
'KongTiao': '空调',
|
||||
'Desk': '桌子',
|
||||
'Clip': '夹子',
|
||||
'TuoPan': '托盘',
|
||||
'BoJi': '簸箕',
|
||||
'ZhiBeiHe': '纸杯盒',
|
||||
'WaterCup': '水杯',
|
||||
'Chair': '椅子',
|
||||
'Hand': '手',
|
||||
'XiGuan': '吸管',
|
||||
'Container': '容器',
|
||||
'IceMachine': '制冰机',
|
||||
'KaoXiang': '烤箱',
|
||||
'SaoBa': '扫把',
|
||||
'XiangGui': '香柜',
|
||||
}
|
||||
objname_zh2en_dic_goal = dict(zip(objname_en2zh_dic_goal.values(), objname_en2zh_dic_goal.keys()))
|
||||
# print(objname_zh2eh_dic)
|
||||
|
||||
def show_image(camera_data):
|
||||
print('------------------show_image----------------------')
|
||||
|
@ -66,6 +202,9 @@ class Scene:
|
|||
# camera_interval = 1.5
|
||||
output_path = os.path.join(os.path.dirname(__file__), "outputs")
|
||||
|
||||
objname_en2zh_dic = objname_en2zh_dic_goal
|
||||
objname_zh2en_dic = objname_zh2en_dic_goal
|
||||
|
||||
default_state = {
|
||||
"map": {
|
||||
"2d": None,
|
||||
|
@ -124,7 +263,7 @@ class Scene:
|
|||
# 是否展示UI
|
||||
self.show_ui = False
|
||||
# 图像分割
|
||||
self.take_picture = False
|
||||
self.take_picture = True
|
||||
self.map_ratio = 5
|
||||
self.map_map = np.zeros((math.ceil(950 / self.map_ratio), math.ceil(1850 / self.map_ratio)))
|
||||
self.db = DBSCAN(eps=self.map_ratio, min_samples=int(self.map_ratio / 2))
|
||||
|
@ -880,6 +1019,8 @@ class Scene:
|
|||
scene = self.stub.AddObjects(GrabSim_pb2.ObjectList(objects=obj_list, scene=self.sceneID))
|
||||
time.sleep(1.0)
|
||||
|
||||
|
||||
|
||||
# 实现抓握操作
|
||||
def grasp_obj(self, obj_id, hand_id=1):
|
||||
print('------------------adjust_joints----------------------')
|
||||
|
@ -1142,6 +1283,10 @@ class Scene:
|
|||
def getDistance(self, pos1, pos2):
|
||||
return math.sqrt((pos1[0] - pos2[0]) ** 2 + (pos1[1] - pos2[1]) ** 2)
|
||||
|
||||
def getDistanc3D(self, pos1, pos2):
|
||||
return math.sqrt((pos1[0] - pos2[0]) ** 2 + (pos1[1] - pos2[1]) ** 2+ (pos1[2] - pos2[2]) ** 2)
|
||||
|
||||
|
||||
def getNearestFrontier(self, cur_pos, frontiers):
|
||||
dis_min = sys.maxsize
|
||||
frontier_best = None
|
||||
|
@ -1456,7 +1601,16 @@ class Scene:
|
|||
# plt.text(0, 0.1, f'已存语义信息:{self.infoCount}', fontsize=10)
|
||||
# 元组传参 pyqt5中的函数名, 四个参数
|
||||
|
||||
self.ui_func(("get_info", walker_detect_count, obj_detect_count, update_info_count, self.infoCount))
|
||||
# self.ui_func(("get_info", walker_detect_count, obj_detect_count, update_info_count, self.infoCount))
|
||||
semantic_info_str=""
|
||||
semantic_info_str+= f'检测行人数量:{walker_detect_count}'+"\n"
|
||||
semantic_info_str += f'检测物体数量:{obj_detect_count}' + "\n"
|
||||
semantic_info_str += f'更新语义信息:{update_info_count}' + "\n"
|
||||
semantic_info_str += f'已存语义信息:{self.infoCount}' + "\n"
|
||||
|
||||
# print("======semantic_info_str===========")
|
||||
|
||||
self.ui_func(("get_semantic_info", semantic_info_str))
|
||||
|
||||
# draw figures
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import importlib
|
||||
import os
|
||||
|
||||
from PyQt5.QtSvg import QGraphicsSvgItem, QSvgWidget
|
||||
from PyQt5.QtWidgets import QApplication, QMainWindow, QListWidgetItem, QGraphicsView, QGraphicsScene, \
|
||||
QGraphicsPixmapItem
|
||||
QGraphicsPixmapItem, QGraphicsProxyWidget
|
||||
from PyQt5.QtCore import QTimer, QPoint, QRectF
|
||||
from PyQt5 import QtCore
|
||||
import sys
|
||||
|
||||
from robowaiter.scene.ui.window import Ui_MainWindow
|
||||
|
@ -11,7 +13,7 @@ from robowaiter.utils.basic import get_root_path
|
|||
from PyQt5.QtCore import QThread
|
||||
import queue
|
||||
import numpy as np
|
||||
from PyQt5.QtGui import QImage, QPixmap, QDrag
|
||||
from PyQt5.QtGui import QImage, QPixmap, QDrag, QPainter
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtCore import QThread, pyqtSignal
|
||||
from robowaiter.scene.ui.scene_ui import SceneUI
|
||||
|
@ -56,6 +58,29 @@ def run_scene(scene_cls,robot_cls,scene_queue,ui_queue):
|
|||
# print("Robot system error:", str(e))
|
||||
|
||||
example_list = ("AEM","VLN","VLM",'GQA',"OT","AT","reset")
|
||||
more_example_list = ("VLM_AC","CafeDaily")
|
||||
dic_more2zh={
|
||||
"VLM_AC":"开空调并调节空调温度",
|
||||
"CafeDaily":"咖啡厅的一天"
|
||||
}
|
||||
more_example_list_zh = [value for value in dic_more2zh.values()]
|
||||
|
||||
class GraphicsView(QGraphicsView):
|
||||
def __init__(self, parent=None):
|
||||
super(GraphicsView, self).__init__(parent)
|
||||
self.setRenderHint(QPainter.Antialiasing)
|
||||
self.setOptimizationFlag(QGraphicsView.DontAdjustForAntialiasing, True)
|
||||
self.setViewportUpdateMode(QGraphicsView.FullViewportUpdate)
|
||||
self.setDragMode(QGraphicsView.ScrollHandDrag)
|
||||
self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
|
||||
def wheelEvent(self, event):
|
||||
factor = 1.15
|
||||
if event.angleDelta().y() > 0:
|
||||
self.scale(factor, factor)
|
||||
else:
|
||||
self.scale(1.0 / factor, 1.0 / factor)
|
||||
|
||||
class UI(QMainWindow, Ui_MainWindow):
|
||||
scene = None
|
||||
|
@ -78,6 +103,10 @@ class UI(QMainWindow, Ui_MainWindow):
|
|||
|
||||
# 绑定说话按钮
|
||||
self.btn_say.clicked.connect(self.btn_say_on_click)
|
||||
self.verticalLayout_2.removeWidget(self.img_view_bt)
|
||||
self.img_view_bt = GraphicsView(self.centralwidget)
|
||||
self.img_view_bt.setObjectName("img_view_bt")
|
||||
self.verticalLayout_2.addWidget(self.img_view_bt)
|
||||
self.img_view_bt.setDragMode(QGraphicsView.ScrollHandDrag)
|
||||
|
||||
|
||||
|
@ -90,12 +119,12 @@ class UI(QMainWindow, Ui_MainWindow):
|
|||
# self.drag_start_position = QPoint() # 记录鼠标按下时的位置
|
||||
|
||||
self.cb_task.setCurrentIndex(-1)
|
||||
self.cb_task.setPlaceholderText("请选择城市")
|
||||
self.cb_task.setPlaceholderText("请选择更多任务")
|
||||
|
||||
# 多个添加条目
|
||||
self.cb_task.addItems(['Java', 'C#', 'PHP'])
|
||||
self.cb_task.addItems(more_example_list_zh)
|
||||
# 当下拉索引发生改变时发射信号触发绑定的事件
|
||||
self.cb_task.currentIndexChanged.connect(self.selectionchange)
|
||||
self.cb_task.currentIndexChanged.connect(self.cb_selectionchange)
|
||||
|
||||
# 绑定任务演示按钮
|
||||
for example in example_list:
|
||||
|
@ -116,24 +145,15 @@ class UI(QMainWindow, Ui_MainWindow):
|
|||
|
||||
sys.exit(app.exec_())
|
||||
|
||||
def selectionchange(self, i):
|
||||
def cb_selectionchange(self, i):
|
||||
print(i)
|
||||
# self.create_example_click(dic[i])
|
||||
# 标签用来显示选中的文本
|
||||
# currentText():返回选中选项的文本
|
||||
# self.btn1.setText(self.cb.currentText())
|
||||
# print('Items in the list are:')
|
||||
# # 输出选项集合中每个选项的索引与对应的内容
|
||||
# # count():返回选项集合中的数目
|
||||
# for count in range(self.cb.count()):
|
||||
# print('Item' + str(count) + '=' + self.cb.itemText(count))
|
||||
# print('current index', i, 'selection changed', self.cb.currentText())
|
||||
self.create_example_click(more_example_list[i])()
|
||||
|
||||
def get_info(self, walker_detect_count, obj_detect_count, update_info_count, infoCount):
|
||||
print(obj_detect_count)
|
||||
self.textEdit_5.clear()
|
||||
self.textEdit_5.append(str(obj_detect_count))
|
||||
# self.textEdit_5.setText(walker_detect_count + "_" + obj_detect_count + "_" + update_info_count + "_" + infoCount)
|
||||
def get_semantic_info(self, semantic_info_str):
|
||||
# self.textEdit_5.clear()
|
||||
# self.textEdit_5.append(semantic_info_str)
|
||||
self.textBrowser_5.clear()
|
||||
self.textBrowser_5.append(semantic_info_str)
|
||||
|
||||
def new_history(self,customer_name,chat):
|
||||
role = chat["role"]
|
||||
|
@ -246,6 +266,17 @@ class UI(QMainWindow, Ui_MainWindow):
|
|||
self.img_view_bt.setScene(scene)
|
||||
pixmap_item = QGraphicsPixmapItem(pixmap)
|
||||
scene.addItem(pixmap_item)
|
||||
|
||||
|
||||
# widget = QSvgWidget(file_name)
|
||||
# # widget.resize(10000, 1600)
|
||||
# svg_width = widget.width()
|
||||
# widget.resize(svg_width*2, 1600)
|
||||
# proxy = QGraphicsProxyWidget()
|
||||
# proxy.setWidget(widget)
|
||||
# scene.addItem(+proxy)
|
||||
|
||||
|
||||
elif control_name == "img_label_obj":
|
||||
return
|
||||
# self.label.setPixmap(pixmap)
|
||||
|
|
|
@ -10,13 +10,15 @@ import pickle
|
|||
import time
|
||||
import os
|
||||
|
||||
from robowaiter.scene.scene import Scene
|
||||
|
||||
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
|
||||
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
|
||||
|
||||
from robowaiter.utils import get_root_path
|
||||
root_path = get_root_path()
|
||||
|
||||
from robowaiter.scene.scene import Scene
|
||||
|
||||
from robowaiter.utils.bt.draw import render_dot_tree
|
||||
|
||||
|
||||
|
@ -160,20 +162,30 @@ class SceneUI(Scene):
|
|||
|
||||
self.new_event_list = [
|
||||
(5, self.customer_say, (0, "请问哪里有空位啊?")),
|
||||
(13, self.customer_say, (0, "我想坐高凳子。")),
|
||||
(13, self.customer_say, (0, "我想坐高脚凳子。")),
|
||||
(3, self.customer_say, (0, "你带我去吧。")),
|
||||
(45, self.control_walker, (0, False, 100, -250, 480, -90)),
|
||||
(60, self.control_walker, (0, False, 100, -250, 480, -90)), #45
|
||||
(-1, self.customer_say, (0, "谢谢你!这儿还不错!")),
|
||||
]
|
||||
|
||||
def run_VLM(self):
|
||||
# 场景一 拿放物品
|
||||
self.gen_obj()
|
||||
self.state["condition_set"]={'At(Robot,Bar)', 'Is(AC,Off)',
|
||||
'Holding(Nothing)', 'Exist(Yogurt)', 'Exist(BottledDrink)',
|
||||
'Exist(Softdrink)',
|
||||
'Exist(Chips)', 'Exist(NFCJuice)', 'Exist(Bernachon)', 'Exist(ADMilk)', 'Exist(SpringWater)'
|
||||
'Exist(VacuumCup)', 'On(VacuumCup,Table2)',
|
||||
'Is(HallLight,Off)', 'Is(TubeLight,On)', 'Is(Curtain,On)',
|
||||
'Is(Table1,Dirty)', 'Is(Floor,Dirty)', 'Is(Chairs,Dirty)'}
|
||||
|
||||
self.add_walkers([[4,1, 880], [31,250, 1200],[6,-55, 750],[10,70, -200],[27,-290, 400, 180],[26, 60,-320,90]])
|
||||
self. control_walkers(walker_loc=[[-55, 750], [70, -200], [250, 1200], [0, 880]],is_autowalk = True)
|
||||
# self.control_walkers(walker_loc=[[-55, 750], [70, -200], [250, 1200], [0, 880]],is_autowalk = True)
|
||||
self.control_walkers(walker_loc=[[-55, 750]], is_autowalk=True)
|
||||
self.signal_event_list = [
|
||||
(3, self.add_walker, (20,0,700)),
|
||||
(1, self.control_walker, (6, False,100, 60, 520,0)),
|
||||
(1, self.customer_say, (6, "给我来份薯片和果汁,我坐在对面的桌子那儿。")),
|
||||
(1, self.customer_say, (6, "给我来份薯片和果汁,我坐在对面的水杯桌那儿。")), #给我来份薯片和果汁,我坐在对面的桌子那儿。
|
||||
(5, self.control_walker, (6, False, 100, -250, 480, 0)),
|
||||
]
|
||||
pass
|
||||
|
@ -220,6 +232,26 @@ class SceneUI(Scene):
|
|||
]
|
||||
pass
|
||||
|
||||
|
||||
def run_VLM_AC(self):
|
||||
# 开关空调
|
||||
# 场景二 开和调节空调温度
|
||||
self.gen_obj()
|
||||
self.add_walkers([[4,1, 880], [31,250, 1200],[6,-55, 750],[10,70, -200],[27,-290, 400, 180],[26, 60,-320,90]])
|
||||
self.control_walkers(walker_loc=[[-55, 750]],is_autowalk = True)
|
||||
self.signal_event_list = [
|
||||
(3, self.add_walker, (0,0,700)),
|
||||
(1, self.control_walker, (6, False,100, 60, 520,0)), #[walkerID,autowalk,speed,X,Y,Yaw]
|
||||
(2, self.customer_say, (6, "好热呀,想开空调,想要温度调低点!")),
|
||||
(6, self.control_walker, (6, False, 200, 60, 80, 0)),
|
||||
(-1, self.customer_say, (6, "谢谢!这下凉快了!")), #(-100,600)
|
||||
]
|
||||
pass
|
||||
|
||||
def run_CafeDaily(self):
|
||||
pass
|
||||
|
||||
|
||||
def run_reset(self):
|
||||
pass
|
||||
|
||||
|
@ -232,8 +264,9 @@ class SceneUI(Scene):
|
|||
self.draw_current_bt()
|
||||
|
||||
def draw_current_bt(self):
|
||||
render_dot_tree(self.robot.bt.root,target_directory=self.output_path,name="current_bt")
|
||||
render_dot_tree(self.robot.bt.root,target_directory=self.output_path,name="current_bt",png_only=True)
|
||||
self.ui_queue.put(('draw_from_file',"img_view_bt", f"{self.output_path}/current_bt.png"))
|
||||
# self.ui_queue.put(('draw_from_file', "img_view_bt", f"{self.output_path}/current_bt.svg"))
|
||||
|
||||
def ui_func(self,args):
|
||||
# _,_,output_path = args
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Form implementation generated from reading ui file 'window.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
# Created by: PyQt5 UI code generator 5.15.10
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
@ -101,45 +101,6 @@ class Ui_MainWindow(object):
|
|||
self.gridLayout_3.addLayout(self.verticalLayout_2, 1, 0, 1, 1)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout()
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.img_label_map = QtWidgets.QLabel(self.centralwidget)
|
||||
self.img_label_map.setEnabled(True)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.img_label_map.sizePolicy().hasHeightForWidth())
|
||||
self.img_label_map.setSizePolicy(sizePolicy)
|
||||
self.img_label_map.setMinimumSize(QtCore.QSize(345, 200))
|
||||
self.img_label_map.setStyleSheet("border: 2px solid black;")
|
||||
self.img_label_map.setText("")
|
||||
self.img_label_map.setObjectName("img_label_map")
|
||||
self.horizontalLayout_5.addWidget(self.img_label_map)
|
||||
self.img_label_seg = QtWidgets.QLabel(self.centralwidget)
|
||||
self.img_label_seg.setEnabled(True)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.img_label_seg.sizePolicy().hasHeightForWidth())
|
||||
self.img_label_seg.setSizePolicy(sizePolicy)
|
||||
self.img_label_seg.setMinimumSize(QtCore.QSize(250, 200))
|
||||
self.img_label_seg.setStyleSheet("border: 2px solid black;")
|
||||
self.img_label_seg.setText("")
|
||||
self.img_label_seg.setObjectName("img_label_seg")
|
||||
self.horizontalLayout_5.addWidget(self.img_label_seg)
|
||||
self.img_label_obj = QtWidgets.QLabel(self.centralwidget)
|
||||
self.img_label_obj.setEnabled(True)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.img_label_obj.sizePolicy().hasHeightForWidth())
|
||||
self.img_label_obj.setSizePolicy(sizePolicy)
|
||||
self.img_label_obj.setMinimumSize(QtCore.QSize(250, 200))
|
||||
self.img_label_obj.setStyleSheet("border: 2px solid black;")
|
||||
self.img_label_obj.setText("")
|
||||
self.img_label_obj.setObjectName("img_label_obj")
|
||||
self.horizontalLayout_5.addWidget(self.img_label_obj)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout_5, 1, 0, 1, 1)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setContentsMargins(0, -1, -1, -1)
|
||||
self.horizontalLayout_4.setSpacing(0)
|
||||
|
@ -184,14 +145,92 @@ class Ui_MainWindow(object):
|
|||
self.label_8.setObjectName("label_8")
|
||||
self.horizontalLayout_4.addWidget(self.label_8)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout_4, 0, 0, 1, 1)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.img_label_map = QtWidgets.QLabel(self.centralwidget)
|
||||
self.img_label_map.setEnabled(True)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.img_label_map.sizePolicy().hasHeightForWidth())
|
||||
self.img_label_map.setSizePolicy(sizePolicy)
|
||||
self.img_label_map.setMinimumSize(QtCore.QSize(345, 200))
|
||||
self.img_label_map.setStyleSheet("border: 2px solid black;")
|
||||
self.img_label_map.setText("")
|
||||
self.img_label_map.setObjectName("img_label_map")
|
||||
self.horizontalLayout_5.addWidget(self.img_label_map)
|
||||
self.img_label_seg = QtWidgets.QLabel(self.centralwidget)
|
||||
self.img_label_seg.setEnabled(True)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.img_label_seg.sizePolicy().hasHeightForWidth())
|
||||
self.img_label_seg.setSizePolicy(sizePolicy)
|
||||
self.img_label_seg.setMinimumSize(QtCore.QSize(250, 200))
|
||||
self.img_label_seg.setStyleSheet("border: 2px solid black;")
|
||||
self.img_label_seg.setText("")
|
||||
self.img_label_seg.setObjectName("img_label_seg")
|
||||
self.horizontalLayout_5.addWidget(self.img_label_seg)
|
||||
self.img_label_obj = QtWidgets.QLabel(self.centralwidget)
|
||||
self.img_label_obj.setEnabled(True)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.img_label_obj.sizePolicy().hasHeightForWidth())
|
||||
self.img_label_obj.setSizePolicy(sizePolicy)
|
||||
self.img_label_obj.setMinimumSize(QtCore.QSize(250, 200))
|
||||
self.img_label_obj.setStyleSheet("border: 2px solid black;")
|
||||
self.img_label_obj.setText("")
|
||||
self.img_label_obj.setObjectName("img_label_obj")
|
||||
self.horizontalLayout_5.addWidget(self.img_label_obj)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout_5, 1, 0, 1, 1)
|
||||
self.gridLayout_3.addLayout(self.gridLayout_2, 0, 0, 1, 1)
|
||||
self.gridLayout.addLayout(self.gridLayout_3, 6, 0, 1, 3)
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.textEdit_5 = QtWidgets.QTextEdit(self.centralwidget)
|
||||
self.textEdit_5.setObjectName("textEdit_5")
|
||||
self.verticalLayout_3.addWidget(self.textEdit_5)
|
||||
self.textBrowser_5 = QtWidgets.QTextBrowser(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(13)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.textBrowser_5.setFont(font)
|
||||
self.textBrowser_5.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.textBrowser_5.setStyleSheet("text-align:center;")
|
||||
self.textBrowser_5.setMarkdown("")
|
||||
self.textBrowser_5.setObjectName("textBrowser_5")
|
||||
self.verticalLayout_3.addWidget(self.textBrowser_5)
|
||||
self.gridLayout.addLayout(self.verticalLayout_3, 5, 0, 1, 1)
|
||||
self.label_9 = QtWidgets.QLabel(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("等线")
|
||||
font.setPointSize(10)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_9.setFont(font)
|
||||
self.label_9.setObjectName("label_9")
|
||||
self.gridLayout.addWidget(self.label_9, 0, 0, 1, 1)
|
||||
self.btn_say = QtWidgets.QPushButton(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(14)
|
||||
self.btn_say.setFont(font)
|
||||
self.btn_say.setObjectName("btn_say")
|
||||
self.gridLayout.addWidget(self.btn_say, 0, 2, 1, 1)
|
||||
self.edit_say = QtWidgets.QLineEdit(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Times New Roman")
|
||||
font.setPointSize(14)
|
||||
self.edit_say.setFont(font)
|
||||
self.edit_say.setObjectName("edit_say")
|
||||
self.gridLayout.addWidget(self.edit_say, 0, 1, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(14)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 4, 0, 1, 1)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.btn_reset = QtWidgets.QPushButton(self.centralwidget)
|
||||
|
@ -250,42 +289,16 @@ class Ui_MainWindow(object):
|
|||
sizePolicy.setHeightForWidth(self.cb_task.sizePolicy().hasHeightForWidth())
|
||||
self.cb_task.setSizePolicy(sizePolicy)
|
||||
self.cb_task.setMinimumSize(QtCore.QSize(0, 25))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(14)
|
||||
self.cb_task.setFont(font)
|
||||
self.cb_task.setEditable(True)
|
||||
self.cb_task.setCurrentText("")
|
||||
self.cb_task.setInsertPolicy(QtWidgets.QComboBox.InsertAtBottom)
|
||||
self.cb_task.setObjectName("cb_task")
|
||||
self.verticalLayout.addWidget(self.cb_task)
|
||||
self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1)
|
||||
self.label_9 = QtWidgets.QLabel(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("等线")
|
||||
font.setPointSize(10)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label_9.setFont(font)
|
||||
self.label_9.setObjectName("label_9")
|
||||
self.gridLayout.addWidget(self.label_9, 0, 0, 1, 1)
|
||||
self.btn_say = QtWidgets.QPushButton(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(14)
|
||||
self.btn_say.setFont(font)
|
||||
self.btn_say.setObjectName("btn_say")
|
||||
self.gridLayout.addWidget(self.btn_say, 0, 2, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(14)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 4, 0, 1, 1)
|
||||
self.edit_say = QtWidgets.QLineEdit(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Times New Roman")
|
||||
font.setPointSize(14)
|
||||
self.edit_say.setFont(font)
|
||||
self.edit_say.setObjectName("edit_say")
|
||||
self.gridLayout.addWidget(self.edit_say, 0, 1, 1, 1)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName("statusbar")
|
||||
|
@ -311,6 +324,15 @@ class Ui_MainWindow(object):
|
|||
self.label_6.setText(_translate("MainWindow", "可达性地图"))
|
||||
self.label_7.setText(_translate("MainWindow", "实例分割"))
|
||||
self.label_8.setText(_translate("MainWindow", "目标检测"))
|
||||
self.textBrowser_5.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'黑体\'; font-size:13pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;\"><br /></p></body></html>"))
|
||||
self.label_9.setText(_translate("MainWindow", "任务演示:(播放动画时需等待动画播放完毕才会重置场景)"))
|
||||
self.btn_say.setText(_translate("MainWindow", "说话"))
|
||||
self.edit_say.setText(_translate("MainWindow", "Is(AC,On)"))
|
||||
self.label.setText(_translate("MainWindow", "语义信息"))
|
||||
self.btn_reset.setText(_translate("MainWindow", "重置场景"))
|
||||
self.btn_AEM.setText(_translate("MainWindow", "环境主动探索"))
|
||||
self.btn_VLN.setText(_translate("MainWindow", "视觉语言导航"))
|
||||
|
@ -319,10 +341,6 @@ class Ui_MainWindow(object):
|
|||
self.btn_OT.setText(_translate("MainWindow", "开放具身任务"))
|
||||
self.btn_AT.setText(_translate("MainWindow", "自主具身任务"))
|
||||
self.cb_task.setPlaceholderText(_translate("MainWindow", "其他任务"))
|
||||
self.label_9.setText(_translate("MainWindow", "任务演示:(播放动画时需等待动画播放完毕才会重置场景)"))
|
||||
self.btn_say.setText(_translate("MainWindow", "说话"))
|
||||
self.label.setText(_translate("MainWindow", "语义信息"))
|
||||
self.edit_say.setText(_translate("MainWindow", "Is(AC,On)"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -153,85 +153,6 @@
|
|||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="img_label_map">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>345</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 2px solid black;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="img_label_seg">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 2px solid black;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="img_label_obj">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 2px solid black;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="spacing">
|
||||
|
@ -317,6 +238,85 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="img_label_map">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>345</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 2px solid black;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="img_label_seg">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 2px solid black;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="img_label_obj">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 2px solid black;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -324,10 +324,89 @@
|
|||
<item row="5" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit_5"/>
|
||||
<widget class="QTextBrowser" name="textBrowser_5">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>13</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">text-align:center;</string>
|
||||
</property>
|
||||
<property name="markdown">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'黑体'; font-size:13pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>等线</family>
|
||||
<pointsize>10</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>任务演示:(播放动画时需等待动画播放完毕才会重置场景)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="btn_say">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>说话</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="edit_say">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Times New Roman</family>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Is(AC,On)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>语义信息</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
|
@ -435,6 +514,12 @@
|
|||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
|
@ -454,60 +539,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>等线</family>
|
||||
<pointsize>10</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>任务演示:(播放动画时需等待动画播放完毕才会重置场景)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="btn_say">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>说话</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>语义信息</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="edit_say">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Times New Roman</family>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Is(AC,On)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
|
|
|
@ -1,10 +1,26 @@
|
|||
selector{
|
||||
cond On(Yogurt,Bar)
|
||||
sequence{
|
||||
cond Holding(Nothing)
|
||||
sequence{
|
||||
cond Is(Curtain,Off)
|
||||
act Turn(Curtain,On)
|
||||
cond Holding(Yogurt)
|
||||
cond At(Robot,Bar)
|
||||
act PutDown(Yogurt,Bar)
|
||||
}
|
||||
sequence{
|
||||
cond Is(AC,Off)
|
||||
act Turn(AC,On)
|
||||
}}
|
||||
cond Holding(Yogurt)
|
||||
act MoveTo(Bar)
|
||||
}
|
||||
sequence{
|
||||
cond Holding(Nothing)
|
||||
cond At(Robot,Yogurt)
|
||||
act PickUp(Yogurt)
|
||||
}
|
||||
sequence{
|
||||
cond At(Robot,Yogurt)
|
||||
act FreeHands()
|
||||
}
|
||||
sequence{
|
||||
cond Holding(Nothing)
|
||||
cond Exist(Yogurt)
|
||||
act MoveTo(Yogurt)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,29 +1,38 @@
|
|||
selector
|
||||
Selector
|
||||
{
|
||||
sequence
|
||||
cond On(Yogurt,Bar)
|
||||
Sequence
|
||||
{
|
||||
cond Chatting()
|
||||
act DealChat()
|
||||
} sequence
|
||||
cond Holding(Yogurt)
|
||||
cond At(Robot,Bar)
|
||||
act PutDown(Yogurt,Bar)
|
||||
} Sequence
|
||||
{
|
||||
cond HasSubTask()
|
||||
sequence
|
||||
cond Holding(Yogurt)
|
||||
act MoveTo(Bar)
|
||||
} Sequence
|
||||
{
|
||||
act SubTaskPlaceHolder()
|
||||
} } sequence
|
||||
cond Holding(Nothing)
|
||||
cond At(Robot,Yogurt)
|
||||
cond At(Robot,Bar)
|
||||
act PickUp(Yogurt)
|
||||
} Sequence
|
||||
{
|
||||
cond FocusingCustomer()
|
||||
act ServeCustomer()
|
||||
} sequence
|
||||
cond Holding(Nothing)
|
||||
cond At(Robot,Yogurt)
|
||||
act PickUp(Yogurt)
|
||||
} Sequence
|
||||
{
|
||||
cond NewCustomer()
|
||||
selector
|
||||
cond At(Robot,Yogurt)
|
||||
cond At(Robot,Bar)
|
||||
act FreeHands()
|
||||
} Sequence
|
||||
{
|
||||
cond At(Robot,Bar)
|
||||
act MoveTo(Bar)
|
||||
} act GreetCustomer()
|
||||
} sequence
|
||||
cond At(Robot,Yogurt)
|
||||
act FreeHands()
|
||||
} Sequence
|
||||
{
|
||||
cond AnomalyDetected()
|
||||
act ResolveAnomaly()
|
||||
cond Holding(Nothing)
|
||||
cond Exist(Yogurt)
|
||||
act MoveTo(Yogurt)
|
||||
}}
|
Binary file not shown.
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 101 KiB |
|
@ -18,7 +18,32 @@ class SceneOT(Scene):
|
|||
super().__init__(robot)
|
||||
# 在这里加入场景中发生的事件
|
||||
self.signal_event_list = [
|
||||
(3, self.customer_say, ("System", "冰红茶")),
|
||||
# (3, self.customer_say, ("System", "有多少盒装饮料")),
|
||||
# (3, self.customer_say, ("System", "桌子有几张")),
|
||||
# (3, self.customer_say, ("System", "你们这儿有军棋吗")),
|
||||
# (3, self.customer_say, ("System", "军棋有几个")),
|
||||
# (3, self.customer_say, ("System", "有几把椅子呀")),
|
||||
# (3, self.customer_say, ("System", "有多少顾客")),
|
||||
# (3, self.customer_say, ("System", "你们这儿有多少军棋")),
|
||||
|
||||
# (3, self.customer_say, ("System", "哪里有盒装饮料?")),
|
||||
# (3, self.customer_say, ("System", "洗手间在哪里?")),卫生间
|
||||
# (3, self.customer_say, ("System", "卫生间在哪里?")),
|
||||
|
||||
# (3, self.customer_say, ("System", "你们这里有棋吗,在哪里")),
|
||||
|
||||
# (3, self.customer_say, ("System", "有几副棋")),
|
||||
# (3, self.customer_say, ("System", "我的手镯,你有看到吗")),
|
||||
# (3, self.customer_say, ("System", "你们这有小说吗?")),
|
||||
# (3, self.customer_say, ("System", "我昨天保温杯落在你们咖啡厅了,你看到了吗?")),
|
||||
# (3, self.customer_say, ("System", "你们这有魔方吗?")),
|
||||
# (3, self.customer_say, ("System", "垃圾桶在哪呀?")),
|
||||
|
||||
# (3, self.customer_say, ("System", "这有小说吗?在哪里")),
|
||||
|
||||
|
||||
# (3, self.customer_say, ("System", "把盒装冰红茶放到水桌")),
|
||||
# (3, self.customer_say, ("System", "冰红茶")),
|
||||
# (3, self.customer_say, ("System", "酸奶。")),
|
||||
# (3, self.customer_say, ("System","来一号桌")),
|
||||
# (-1, self.customer_say, ("System","回去吧")),
|
||||
|
@ -30,7 +55,7 @@ class SceneOT(Scene):
|
|||
# ]
|
||||
|
||||
def _reset(self):
|
||||
# self.add_walkers([[0, 880], [250, 1200]])
|
||||
self.add_walkers([[0, 880], [250, 1200]])
|
||||
self.gen_obj()
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in New Issue