From 0b8ca87c08a7aa130edc9bcd05b2a932ddd5104e Mon Sep 17 00:00:00 2001 From: Caiyishuai <39987654+Caiyishuai@users.noreply.github.com> Date: Tue, 21 Nov 2023 00:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E5=92=96=E5=95=A1?= =?UTF-8?q?=E5=8E=85=E7=9A=84=E4=B8=80=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../behavior_lib/cond/FocusingCustomer.py | 4 +- robowaiter/llm_client/data/fix_questions.txt | 10 +- robowaiter/scene/scene.py | 2 +- .../tasks/CafeDailyOperations/CafeOneDay.py | 42 +++++++- .../tasks/CafeDailyOperations/VLN_all.py | 101 +++++++----------- .../VLN_greet_and_order.py | 2 +- .../scene/tasks/GQA/GQA_1_ask_order_place.py | 2 +- 7 files changed, 89 insertions(+), 74 deletions(-) diff --git a/robowaiter/behavior_lib/cond/FocusingCustomer.py b/robowaiter/behavior_lib/cond/FocusingCustomer.py index 1685a85..4a07198 100644 --- a/robowaiter/behavior_lib/cond/FocusingCustomer.py +++ b/robowaiter/behavior_lib/cond/FocusingCustomer.py @@ -11,8 +11,8 @@ class FocusingCustomer(Cond): def _update(self) -> ptree.common.Status: # if self.scene.status? if "customer" in self.scene.state['attention']: - if self.scene.take_picture: - self.scene.get_obstacle_point(self.scene.db, self.status, map_ratio=self.scene.map_ratio) + # if self.scene.take_picture: + # self.scene.get_obstacle_point(self.scene.db, self.status, map_ratio=self.scene.map_ratio) return ptree.common.Status.SUCCESS else: goal = Cond.place_xy_yaw_dic['Bar'] diff --git a/robowaiter/llm_client/data/fix_questions.txt b/robowaiter/llm_client/data/fix_questions.txt index 5ceeb0a..053d559 100644 --- a/robowaiter/llm_client/data/fix_questions.txt +++ b/robowaiter/llm_client/data/fix_questions.txt @@ -74,7 +74,7 @@ create_sub_task 没事儿,为您服务是我的荣幸! 大厅的桌子好啊,快带我去呀! -好的好的,跟我来,我带你去找找。 +好的好的,请跟我来。 create_sub_task {"goal":"At(Robot,WaterTable)"} @@ -97,9 +97,9 @@ create_sub_task 下班啦!别忘了打扫卫生。 -收到!请问您需要来点什么吗? +收到!下班啦! create_sub_task -"{""Is(Floor,Clean)"",""Is(Table1,Clean)"",""Is(Chairs,Clean)"",""Is(AC,Off)"",""Is(HallLight,Off)"",""Is(TubeLight,Off)"",""Is(Curtain,Off)""}" +{"goal":"Is(Floor,Clean),Is(Table1,Clean),Is(Chairs,Clean),Is(AC,Off),Is(HallLight,Off),Is(TubeLight,Off),Is(Curtain,Off)"} 请问洗手间在哪里? @@ -186,7 +186,7 @@ get_object_info get_object_info {"obj":"洗手间"} - - +我带着孩子呢,想要宽敞亮堂的地方。 +好的,我明白了,那么我们推荐您到大厅的桌子,那里的空间比较宽敞,环境也比较明亮,适合带着孩子一起用餐。 diff --git a/robowaiter/scene/scene.py b/robowaiter/scene/scene.py index a6f61c8..5c70b29 100644 --- a/robowaiter/scene/scene.py +++ b/robowaiter/scene/scene.py @@ -122,7 +122,7 @@ class Scene: self.db = DBSCAN(eps=self.map_ratio, min_samples=int(self.map_ratio / 2)) self.infoCount = 0 - self.is_nav_walk = True + self.is_nav_walk = False file_name = os.path.join(root_path,'robowaiter/algos/navigator/map_5.pkl') if os.path.exists(file_name): diff --git a/robowaiter/scene/tasks/CafeDailyOperations/CafeOneDay.py b/robowaiter/scene/tasks/CafeDailyOperations/CafeOneDay.py index 34de4cc..5ad659d 100644 --- a/robowaiter/scene/tasks/CafeDailyOperations/CafeOneDay.py +++ b/robowaiter/scene/tasks/CafeDailyOperations/CafeOneDay.py @@ -27,8 +27,8 @@ class SceneVLM(Scene): (3, self.add_walker, (5, 230, 1200)), # 0号"Girl02_C_3" (1, self.control_walker, (0, False, 200, 60, 520, 0)), (9, self.customer_say, (0, "早上好呀,我想找个能晒太阳的地方。")), - (-1, self.customer_say, (0, "可以带我过去嘛?")), - (0, self.control_walker, (0, False, 50, 140, 1200, 180)), # 小女孩站在了 BrightTable1 旁边就餐啦 + (1, self.customer_say, (0, "可以带我过去嘛?")), + (13, self.control_walker, (0, False, 50, 140, 1200, 180)), # 小女孩站在了 BrightTable1 旁边就餐啦 # # 场景2:有个胖胖男人点单交流并要咖啡,帮他送去角落的桌子 # (3, self.add_walker, (5, 230, 1200)), # 小女孩 @@ -36,13 +36,49 @@ class SceneVLM(Scene): (10, self.add_walker, (26, -28, -150, 90)), (0, self.add_walker, (10, -70, -200, -45)), (6, self.customer_say, (1, "嘿,RoboWaiter,过来一下!")), - (8, self.control_walkers_and_say, ([[[1, False, 100, -18, -200, -90, "你们这有什么饮料嘛?"]]])), + (10, self.control_walkers_and_say, ([[[1, False, 100, -18, -200, -90, "你们这有什么饮料嘛?"]]])), # 20 胖胖男到了 BrightTable6 (2, self.customer_say, (1, "咖啡有哪些呢?")), # 10 (2, self.customer_say, (1, "来杯卡布奇诺吧。")), # 15 + # # 场景3:有位女士要杯水和冰红茶 + (3, self.add_walkers, + ([[[21, 65, 1000, -90], [32, -80, 850, 135], [1, 60, 420, 135], [29, -290, 400, 180]]])), + (0, self.control_walker, (5, True, 50, 250, 1200, 180)), # 设置id=4 的2小男孩随机游走红随机游走 + (0, self.add_walker, (48, 60, 520, 0)), # 生成他妈妈 + (0, self.add_walkers, ([[[48, 60, 520, 0], [31, 60, 600, -90], [20, 60, 680, -90], [9, 60, 760, -90]]])), + (38, self.customer_say, (7, "哎呦,今天这么多人,还有空位吗?")), # 女士问 + (10, self.customer_say, (7, "我带着孩子呢,想要宽敞亮堂的地方。")), # 女士问 + (8, self.customer_say, (7, "大厅的桌子好啊,快带我去呀!")), + (15, self.control_walker, (7, False, 50, -250, 480, 0)), # #290, 400 + (3, self.customer_say, (7, "我想来杯水,帮我孩子拿个酸奶吧。")), + # # ### 9号灰色男 排队排着排着,不排了 + (0, self.control_walker, (10, False, 100, 100, 760, 180)), + (0, self.control_walker, (10, True, 100, 0, 0, 180)), + (90, self.customer_say, (7, "谢谢你的水和酸奶!")), # 倒水+取放酸奶 90s + (10, self.control_walkers_and_say, ([[[8, False, 100, 60, 520, 180, "我昨天保温杯好像落在你们咖啡厅了,你看到了吗?"]]])), + (5, self.customer_say, (8,"你可以帮我拿来吗,我在前门的桌子前等你。")), + (1, self.control_walker,(8, False, 80, -10, 520, 90)),# 红女士在吧台前后退一步 + (1, self.control_walker, (8, False, 80, 240, 1000, -45)), # 红女士走到Table1前 + (1, self.control_walker, (9, False, 100, 60, 600, -90)), # 大胖男排队往前走一步 + (2, self.control_walker, (10, False, 100, 60, 680, -90)), # 男灰黑色排队往前走一步 + (6, self.customer_say, (8,"就是这个杯子!找到啦,好开心!")), # 红女士在Table1前 + (5, self.customer_say, (8, "不用了。")), # 红女士在Table1前 + + + (8, self.remove_walkers, ([[0, 7, 8]])), + (3, self.control_walker, (6, False, 100, 60, 520, 0)), # 10号变7号 男灰黑色排队往前,轮到他 + (2, self.customer_say, (6, "好热呀!太阳也好大!")), + (20, self.control_walkers_and_say, ([[[6, True, 100, 60, 520, 0, "谢谢,这下凉快了"]]])), + + + # # 场景8 结束了,删除所有顾客。此处增加自主探索发现空间比较暗,打开大厅灯 + (24, self.clean_walkers, ()), + (1, self.add_walker, (17, 60, 1000)),# 增加警察,提醒下班啦 + (3, self.control_walkers_and_say, ([[[0, False, 150, 60, 520, 0, "下班啦!别忘了打扫卫生。"]]])), + ] def _reset(self): diff --git a/robowaiter/scene/tasks/CafeDailyOperations/VLN_all.py b/robowaiter/scene/tasks/CafeDailyOperations/VLN_all.py index 8926794..4828d7a 100644 --- a/robowaiter/scene/tasks/CafeDailyOperations/VLN_all.py +++ b/robowaiter/scene/tasks/CafeDailyOperations/VLN_all.py @@ -7,7 +7,6 @@ import time from robowaiter.scene.scene import Scene - class SceneVLM(Scene): def __init__(self, robot): @@ -25,12 +24,11 @@ class SceneVLM(Scene): self.signal_event_list = [ # 场景1:带小女孩找阳光下的空位 - (3, self.add_walker, (5, 230, 1200)), # 0号"Girl02_C_3" + (3, self.add_walker, (5, 230, 1200)), # 0号"Girl02_C_3" (1, self.control_walker, (0, False, 200, 60, 520, 0)), (9, self.customer_say, (0, "早上好呀,我想找个能晒太阳的地方。")), - (-1, self.customer_say, (0,"可以带我过去嘛?")), - (0, self.control_walker, (0, False, 50, 140, 1200, 180)), # 小女孩站在了 BrightTable1 旁边就餐啦 - + (1, self.customer_say, (0, "可以带我过去嘛?")), + (13, self.control_walker, (0, False, 50, 140, 1200, 180)), # 小女孩站在了 BrightTable1 旁边就餐啦 # # 场景2:有个胖胖男人点单交流并要咖啡,帮他送去角落的桌子 # (3, self.add_walker, (5, 230, 1200)), # 小女孩 @@ -38,67 +36,48 @@ class SceneVLM(Scene): (10, self.add_walker, (26, -28, -150, 90)), (0, self.add_walker, (10, -70, -200, -45)), (6, self.customer_say, (1, "嘿,RoboWaiter,过来一下!")), - (8, self.control_walkers_and_say, ([[[1, False, 100, -18, -200, -90, "你们这有什么饮料嘛?"]]])), # 20 胖胖男到了 BrightTable6 - (2, self.customer_say, (1, "咖啡有哪些呢?")),# 10 - (2, self.customer_say, (1,"来杯卡布奇诺吧。")), # 15 + (10, self.control_walkers_and_say, ([[[1, False, 100, -18, -200, -90, "你们这有什么饮料嘛?"]]])), + # 20 胖胖男到了 BrightTable6 + (2, self.customer_say, (1, "咖啡有哪些呢?")), # 10 + (2, self.customer_say, (1, "来杯卡布奇诺吧。")), # 15 # # 场景3:有位女士要杯水和冰红茶 - (30 ,self.add_walkers,([[[21, 65, 1000, -90],[32, -80, 850, 135],[1, 60, 420, 135]]])), - (0, self.control_walker, (5, True, 50, 250, 1200, 180)), #设置id=4 的2小男孩随机游走红随机游走 - (0, self.add_walkers, ([[[48, 60, 520, 0], [31, 60, 600, -90], [20, 60, 680, -90],[9, 60, 760, -90],[29, -290, 400, 180]]])), - - (5, self.customer_say, (6, "哎呦,今天这么多人,还有空位吗?")),# 女士问 - (15, self.customer_say, (6, "我带着孩子呢,想要宽敞亮堂的地方。")), # 女士问 - # 好的,我明白了,那么您可以选择我们的家庭亲子座,这样可以容纳您的孩子,并且更加宽敞舒适。 - # 这里可以加一下自主导航和探索,找到一个位置 - # 好的,我明白了,那么我们推荐您到大厅的桌子,那里的空间比较宽敞,环境也比较明亮,适合带着孩子一起用餐。 - (8, self.customer_say, (6, "大厅的桌子好啊,快带我去呀!")), - (15, self.control_walker, (6, False, 50,-250, 480, 0)), # #290, 400 - (3, self.customer_say, (6, "我想来杯水,帮我孩子拿个酸奶吧。")), - # ### 9号灰色男 排队排着排着,不排了 - (0, self.control_walker, (9, False, 100, 100, 760, 180)), - (0, self.control_walker, (9, True, 100, 0, 0, 180)), - # # ### 增加场景,孩子说热要开空调 或者9号随机游走和说 - (90, self.customer_say, (6, "谢谢!不用了。")), #倒水+取放酸奶 90s + (3, self.add_walkers, + ([[[21, 65, 1000, -90], [32, -80, 850, 135], [1, 60, 420, 135], [29, -290, 400, 180]]])), + (0, self.control_walker, (5, True, 50, 250, 1200, 180)), # 设置id=4 的2小男孩随机游走红随机游走 + (0, self.add_walker, (48, 60, 520, 0)), # 生成他妈妈 + (0, self.add_walkers, ([[[48, 60, 520, 0], [31, 60, 600, -90], [20, 60, 680, -90], [9, 60, 760, -90]]])), + (43, self.customer_say, (7, "哎呦,今天这么多人,还有空位吗?")), # 女士问 + (10, self.customer_say, (7, "我带着孩子呢,想要宽敞亮堂的地方。")), # 女士问 + (8, self.customer_say, (7, "大厅的桌子好啊,快带我去呀!")), + (15, self.control_walker, (7, False, 50, -250, 480, 0)), # #290, 400 + (3, self.customer_say, (7, "来杯酸奶吧。")), # (3, self.customer_say, (7, "我想来杯水,帮我孩子拿个酸奶吧。")), + # # ### 9号灰色男 排队排着排着,不排了 + (0, self.control_walker, (10, False, 100, 100, 760, 180)), + (0, self.control_walker, (10, True, 100, 0, 0, 180)), + (90, self.customer_say, (7, "谢谢你的水和酸奶!")), # 倒水+取放酸奶 90s - - # # # 场景4:三人排队点单,女士要保温杯 - (6, self.control_walkers_and_say, ([[[7, False, 100, 60, 520, 180, "我昨天保温杯好像落在你们咖啡厅了,你看到了吗?"]]])), - (5, self.customer_say, (7,"你可以帮我拿来吗,我在前门的桌子前等你。")), - (1, self.control_walker,(7, False, 80, -10, 520, 90)),# 红女士在吧台前后退一步 - (1, self.control_walker, (7, False, 80, 240, 1000, -45)), # 红女士走到Table1前 - (1, self.control_walker, (8, False, 100, 60, 600, -90)), # 大胖男排队往前走一步 - (2, self.control_walker, (9, False, 100, 60, 680, -90)), # 男灰黑色排队往前走一步 - (6, self.customer_say, (7,"就是这个杯子!找到啦,好开心!")), # 红女士在Table1前 - (5, self.customer_say, (7, "不用了。")), # 红女士在Table1前 + (10, self.control_walkers_and_say, ([[[8, False, 100, 60, 520, 180, "我昨天保温杯好像落在你们咖啡厅了,你看到了吗?"]]])), + (5, self.customer_say, (8,"你可以帮我拿来吗,我在前门的桌子前等你。")), + (1, self.control_walker,(8, False, 80, -10, 520, 90)),# 红女士在吧台前后退一步 + (1, self.control_walker, (8, False, 80, 240, 1000, -45)), # 红女士走到Table1前 + (1, self.control_walker, (9, False, 100, 60, 600, -90)), # 大胖男排队往前走一步 + (2, self.control_walker, (10, False, 100, 60, 680, -90)), # 男灰黑色排队往前走一步 + (6, self.customer_say, (8,"就是这个杯子!找到啦,好开心!")), # 红女士在Table1前 + (5, self.customer_say, (8, "不用了。")), # 红女士在Table1前 - - # # 场景5:三人排队点单,一人要冰红茶,一个要点心,一个没座位了赠送保温杯 - # # 场景6:大胖男点了外卖,离开啦 - (9, self.control_walkers_and_say, ([[[8, False, 100, 60, 520, 0, "给我来份午餐套餐。"]]])), #原来写了26s - (0, self.animation_reset,()), #重置任务 - (6, self.customer_say, (8, "打包吧,快点!")), - (2, self.control_walker, (9, False, 100, 60, 620, -90)), # 男灰黑色排队往前走一步 - (100, self.customer_say, (8, "谢啦,我赶时间!")), #100这个时间很合适 - (2, self.control_walker, (8, False, 250, 20, 520, -90)), # 大胖男着急得离开啦 - (2, self.control_walker, (8, False, 250, 240, -150, -90)), - (5, self.remove_walkers, ([[0,7,8]])), - - - # 场景7:最后排队那个随机游走 9号变为6号,随机游走。 - # 机器人自主发现任务,走一圈去擦桌子/拖地,碰到灰色男问好,灰色男说“太阳大,要关窗帘和空调调低” - # 开了空调 - (2, self.control_walker, (6, False, 100, 60, 520, 0)), # 10号变7号 男灰黑色排队往前,轮到他 + (8, self.remove_walkers, ([[0, 7, 8]])), + (3, self.control_walker, (6, False, 100, 60, 520, 0)), # 10号变7号 男灰黑色排队往前,轮到他 (2, self.customer_say, (6, "好热呀!太阳也好大!")), - (10, self.control_walkers_and_say, ([[[6, True, 100, 60, 520, 0, "谢谢,这下凉快了"]]])), + (20, self.control_walkers_and_say, ([[[6, True, 100, 60, 520, 0, "谢谢,这下凉快了"]]])), - # 场景8 结束了,删除所有顾客。此处增加自主探索发现空间比较暗,打开大厅灯 - (3, self.clean_walkers, ()), + + # # 场景8 结束了,删除所有顾客。此处增加自主探索发现空间比较暗,打开大厅灯 + (24, self.clean_walkers, ()), (1, self.add_walker, (17, 60, 1000)),# 增加警察,提醒下班啦 (3, self.control_walkers_and_say, ([[[0, False, 150, 60, 520, 0, "下班啦!别忘了打扫卫生。"]]])), - (3, self.control_walkers_and_say, ([[[0, False, 150, 60, 520, 0, "不用了。"]]])), ] @@ -116,19 +95,18 @@ class SceneVLM(Scene): # 好的,这就去开空调 self.walker_followed = False pass - - def _step(self): + def _step(self): if self.scene_flag == 1: # 如果机器人不在 吧台 if self.walker_followed: return end = [self.status.location.X, self.status.location.Y] - if end[1]>=600 or end[1]<=450 or end[0]>=250: - # if int(self.status.location.X)!=247 or int(self.status.location.X)!=520: + if end[1] >= 600 or end[1] <= 450 or end[0] >= 250: + # if int(self.status.location.X)!=247 or int(self.status.location.X)!=520: self.walker_followed = True - self.control_walkers_and_say([[0,False,150,end[0],end[1],90,"谢谢!"]]) + self.control_walkers_and_say([[0, False, 150, end[0], end[1], 90, "谢谢!"]]) self.scene_flag += 1 # 获得所有顾客的名字 @@ -138,6 +116,7 @@ class SceneVLM(Scene): # print("=================") pass + if __name__ == '__main__': import os from robowaiter.robot.robot import Robot diff --git a/robowaiter/scene/tasks/CafeDailyOperations/VLN_greet_and_order.py b/robowaiter/scene/tasks/CafeDailyOperations/VLN_greet_and_order.py index 654ab2e..246898b 100644 --- a/robowaiter/scene/tasks/CafeDailyOperations/VLN_greet_and_order.py +++ b/robowaiter/scene/tasks/CafeDailyOperations/VLN_greet_and_order.py @@ -73,7 +73,7 @@ class SceneVLM(Scene): (0, self.control_walker, (10, False, 100, 100, 760, 180)), (0, self.control_walker, (10, True, 100, 0, 0, 180)), # # # ### 增加场景,孩子说热要开空调 或者9号随机游走和说 - # # (90, self.customer_say, (7, "谢谢!")), #倒水+取放酸奶 90s + (90, self.customer_say, (7, "谢谢!")), #倒水+取放酸奶 90s # (3, self.customer_say, (7, "谢谢!")), diff --git a/robowaiter/scene/tasks/GQA/GQA_1_ask_order_place.py b/robowaiter/scene/tasks/GQA/GQA_1_ask_order_place.py index f5b48c6..1e0112e 100644 --- a/robowaiter/scene/tasks/GQA/GQA_1_ask_order_place.py +++ b/robowaiter/scene/tasks/GQA/GQA_1_ask_order_place.py @@ -17,7 +17,7 @@ class SceneGQA(Scene): # 在这里加入场景中发生的事件, (事件发生的时间,事件函数) self.signal_event_list = [ (5, self.customer_say, (6, "你好呀,你们这有啥好吃的?")), # 男 - (15, self.customer_say, (6, "听起来都好甜呀,我女朋友爱吃水果。")), + (8, self.customer_say, (6, "听起来都好甜呀,我女朋友爱吃水果。")), (15, self.customer_say, (6, "你们这人可真多。")), (15, self.customer_say, (6, "我女朋友怕晒,有空余的阴凉位置嘛?")), (15, self.customer_say, (6, "那还不错。")),