From c1019ffb77a7fb1d07ce71657c3389f857c0d651 Mon Sep 17 00:00:00 2001 From: Netceor <45135347+Netceor@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:13:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=9C=E6=A1=8C?= =?UTF-8?q?=E6=8A=93=E6=8F=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robowaiter/llm_client/data/fix_questions.txt | 4 ++++ robowaiter/scene/scene.py | 14 +++++++++----- tasks/OT/Open_tasks_test.py | 3 ++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/robowaiter/llm_client/data/fix_questions.txt b/robowaiter/llm_client/data/fix_questions.txt index 8962f86..1873d9e 100644 --- a/robowaiter/llm_client/data/fix_questions.txt +++ b/robowaiter/llm_client/data/fix_questions.txt @@ -189,4 +189,8 @@ get_object_info 我带着孩子呢,想要宽敞亮堂的地方。 好的,我明白了,那么我们推荐您到大厅的桌子,那里的空间比较宽敞,环境也比较明亮,适合带着孩子一起用餐。 +冰红茶 +好的 +create_sub_task +{"goal":"On(Softdrink,Bar)"} diff --git a/robowaiter/scene/scene.py b/robowaiter/scene/scene.py index 3ae34eb..3ad7054 100644 --- a/robowaiter/scene/scene.py +++ b/robowaiter/scene/scene.py @@ -85,6 +85,7 @@ class Scene: "status": None, # 仿真器中的观测信息,见下方详细解释 "condition_set": {'At(Robot,Bar)', 'Is(AC,Off)', 'Holding(Nothing)', 'Exist(Yogurt)', 'Exist(BottledDrink)', + 'Exist(Softdrink)', # 'On(Yogurt,Bar)','On(BottledDrink,Bar)', # 'Exist(Softdrink)', 'On(Softdrink,Table1)', 'Exist(VacuumCup)', 'On(VacuumCup,Table2)', @@ -735,10 +736,10 @@ class Scene: obj_info = scene.objects[obj_id] obj_x, obj_y, obj_z = obj_info.location.X, obj_info.location.Y, obj_info.location.Z walk_v = [obj_x + 50, obj_y] + [180, 180, 0] + print("obj_y:",obj_y,"obj_x:",obj_x) if 820 <= obj_y <= 1200 and 240 <= obj_x <= 500: # 物品位于斜的抹布桌上 ([240,500],[820,1200]) walk_v = [obj_x + 40, obj_y - 35, 130, 180, 0] - obj_x += 3 - obj_y += 2.5 + print("walk_v:",walk_v) if op_type == 17: # 放置物体,移动到物体周围的可达区域 walk_v = release_pos[:-1] + [180, 180, 0] if release_pos == [340.0, 900.0, 99.0]: @@ -797,10 +798,10 @@ class Scene: # GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 50, y=ginger_loc[1] - 40, z=h, roll=0, pitch=0, yaw=0, type=9), # GrabSim_pb2.ObjectList.Object(x=340, y=960, z=88, roll=0, pitch=0, yaw=90, type=7), # GrabSim_pb2.ObjectList.Object(x=340, y=960, z = 88, roll=0, pitch=0, yaw=90, type=9), - # GrabSim_pb2.ObjectList.Object(x=340, y=952, z=88, roll=0, pitch=0, yaw=90, type=4), + GrabSim_pb2.ObjectList.Object(x=340, y=952, z=88, roll=0, pitch=0, yaw=90, type=4), GrabSim_pb2.ObjectList.Object(x=-102, y=10, z=90, roll=0, pitch=0, yaw=90, type=7), - GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 70, z=95, roll=0, pitch=0, yaw=0, - type=9), + # GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 70, z=95, roll=0, pitch=0, yaw=0, + # type=9), GrabSim_pb2.ObjectList.Object(x=-115, y=200, z=85, roll=0, pitch=0, yaw=90, type=26), # Chess GrabSim_pb2.ObjectList.Object(x=-115, y=250, z=85, roll=0, pitch=0, yaw=90, type=26), # Chess GrabSim_pb2.ObjectList.Object(x=-115, y=280, z=85, roll=0, pitch=0, yaw=90, type=35), # Chess @@ -828,6 +829,9 @@ class Scene: obj_info = scene.objects[obj_id] obj_x, obj_y, obj_z = obj_info.location.X, obj_info.location.Y, obj_info.location.Z + if 820 <= obj_y <= 1200 and 240 <= obj_x <= 500: # 物品位于斜的抹布桌上 ([240,500],[820,1200]) + obj_x += 3 + obj_y += 2.5 if obj_info.name == "CoffeeCup": # obj_x += 1 # obj_y -= 1 diff --git a/tasks/OT/Open_tasks_test.py b/tasks/OT/Open_tasks_test.py index 53b787d..996c28a 100644 --- a/tasks/OT/Open_tasks_test.py +++ b/tasks/OT/Open_tasks_test.py @@ -18,7 +18,8 @@ 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","来一号桌")), # (-1, self.customer_say, ("System","回去吧")), # (5, self.set_goal("At(Robot,BrightTable4)")) From 49ee064d7c19e1dc252309eb6359323c90ae58f9 Mon Sep 17 00:00:00 2001 From: Netceor <45135347+Netceor@users.noreply.github.com> Date: Wed, 22 Nov 2023 21:20:51 +0800 Subject: [PATCH 2/4] Update --- robowaiter/llm_client/data/fix_questions.txt | 6 ++++ robowaiter/scene/scene.py | 37 ++++++++++++-------- tasks/VLM/VLM.py | 34 +++++++++--------- 3 files changed, 46 insertions(+), 31 deletions(-) diff --git a/robowaiter/llm_client/data/fix_questions.txt b/robowaiter/llm_client/data/fix_questions.txt index 1873d9e..f6da6eb 100644 --- a/robowaiter/llm_client/data/fix_questions.txt +++ b/robowaiter/llm_client/data/fix_questions.txt @@ -194,3 +194,9 @@ get_object_info create_sub_task {"goal":"On(Softdrink,Bar)"} + +水杯 +好的 +create_sub_task +{"goal":"On(Glass,Bar)"} + diff --git a/robowaiter/scene/scene.py b/robowaiter/scene/scene.py index 3ad7054..2d72640 100644 --- a/robowaiter/scene/scene.py +++ b/robowaiter/scene/scene.py @@ -736,10 +736,10 @@ class Scene: obj_info = scene.objects[obj_id] obj_x, obj_y, obj_z = obj_info.location.X, obj_info.location.Y, obj_info.location.Z walk_v = [obj_x + 50, obj_y] + [180, 180, 0] - print("obj_y:",obj_y,"obj_x:",obj_x) + if obj_info.name == 'Plate': + walk_v = [obj_x + 51, obj_y] + [180, 180, 0] if 820 <= obj_y <= 1200 and 240 <= obj_x <= 500: # 物品位于斜的抹布桌上 ([240,500],[820,1200]) walk_v = [obj_x + 40, obj_y - 35, 130, 180, 0] - print("walk_v:",walk_v) if op_type == 17: # 放置物体,移动到物体周围的可达区域 walk_v = release_pos[:-1] + [180, 180, 0] if release_pos == [340.0, 900.0, 99.0]: @@ -793,12 +793,19 @@ class Scene: scene = self.status ginger_loc = [scene.location.X, scene.location.Y, scene.location.Z] obj_list = [ + # GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 40, z=95, roll=0, pitch=0, yaw=0, + # type=5), #48是薯片,6是AD钙奶 GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 40, z=95, roll=0, pitch=0, yaw=0, - type=5), + type=57), # GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 50, y=ginger_loc[1] - 40, z=h, roll=0, pitch=0, yaw=0, type=9), # GrabSim_pb2.ObjectList.Object(x=340, y=960, z=88, roll=0, pitch=0, yaw=90, type=7), # GrabSim_pb2.ObjectList.Object(x=340, y=960, z = 88, roll=0, pitch=0, yaw=90, type=9), - GrabSim_pb2.ObjectList.Object(x=340, y=952, z=88, roll=0, pitch=0, yaw=90, type=4), + + # 斜桌三瓶冰红茶 + GrabSim_pb2.ObjectList.Object(x=340, y=965, z=88, roll=0, pitch=0, yaw=90, type=4), + GrabSim_pb2.ObjectList.Object(x=320, y=940, z=88, roll=0, pitch=0, yaw=90, type=4), + GrabSim_pb2.ObjectList.Object(x=300, y=930, z=88, roll=0, pitch=0, yaw=90, type=4), + GrabSim_pb2.ObjectList.Object(x=-102, y=10, z=90, roll=0, pitch=0, yaw=90, type=7), # GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 70, z=95, roll=0, pitch=0, yaw=0, # type=9), @@ -816,13 +823,13 @@ class Scene: scene = self.status # 低头 - value = [0] * 21 - for i in range(21): - value[i] = self.status.joints[i].angle - value[5] = 30 - action = GrabSim_pb2.Action(scene=self.sceneID, action=GrabSim_pb2.Action.ActionType.RotateJoints, values=value) - scene = stub.Do(action) - time.sleep(1.0) + # value = [0] * 21 + # for i in range(21): + # value[i] = self.status.joints[i].angle + # value[5] = 30 + # action = GrabSim_pb2.Action(scene=self.sceneID, action=GrabSim_pb2.Action.ActionType.RotateJoints, values=value) + # scene = stub.Do(action) + # time.sleep(1.0) if self.take_picture: self.get_obstacle_point(self.db, self.status, map_ratio=self.map_ratio) @@ -833,10 +840,10 @@ class Scene: obj_x += 3 obj_y += 2.5 if obj_info.name == "CoffeeCup": - # obj_x += 1 - # obj_y -= 1 - # values = [0,0,0,0,0, 10,-25,-45,-45,-45] - # values= [-6, 0, 0, 0, 0, -6, 0, 45, 45, 45] + # obj_x += 2.5 + # obj_y -= 0.7 # 1.7 + # obj_z -= 6 + # values= [0, 0, 0, 0, 0, 15, -6, -6, -6, -6] # 后5位右手 [-6,45] # stub.Do(GrabSim_pb2.Action(scene=self.sceneID, action=GrabSim_pb2.Action.ActionType.Finger, values=values)) pass if obj_info.name == "Glass": diff --git a/tasks/VLM/VLM.py b/tasks/VLM/VLM.py index eb42cd1..642753d 100644 --- a/tasks/VLM/VLM.py +++ b/tasks/VLM/VLM.py @@ -83,18 +83,19 @@ class SceneVLM(Scene): # "抓握物体","放置物体" # 16-17 # self.gen_obj() - if op_type <=15: - self.move_task_area(op_type) - self.op_task_execute(op_type) - if op_type == 16: # 16: 抓操作需要传入物品id - self.move_task_area(op_type, obj_id=1) - self.op_task_execute(op_type, obj_id=1) - # 原始吧台处:[247.0, 520.0, 100.0], 空调开关旁吧台:[240.0, 40.0, 100.0], 水杯桌:[-70.0, 500.0, 107] - # 桌子1:[-55.0, 0.0, 107],抹布桌:[340.0, 900.0, 99.0] # 桌子2:[-55.0, 150.0, 107], - if op_type == 17: # 17: 放操作需要传入放置位置周围的可达区域 - pos = [240.0, 40.0, 100.0] - self.move_task_area(op_type, release_pos=pos) - self.op_task_execute(op_type, release_pos=pos) # [325.0, 860.0, 100] + # if op_type <=15: + # self.move_task_area(op_type) + # self.op_task_execute(op_type) + # if op_type == 16: # 16: 抓操作需要传入物品id + # self.move_task_area(op_type, obj_id=281) + # self.op_task_execute(op_type, obj_id=281) + # op_type = 17 + # # 原始吧台处:[247.0, 520.0, 100.0], 空调开关旁吧台:[240.0, 40.0, 100.0], 水杯桌:[-70.0, 500.0, 107] + # # 桌子1:[-55.0, 0.0, 107],抹布桌:[340.0, 900.0, 99.0] # 桌子2:[-55.0, 150.0, 107], + # if op_type == 17: # 17: 放操作需要传入放置位置周围的可达区域 + # pos = [240.0, 40.0, 100.0] + # self.move_task_area(op_type, release_pos=pos) + # self.op_task_execute(op_type, release_pos=pos) # [325.0, 860.0, 100] @@ -111,11 +112,12 @@ class SceneVLM(Scene): # self.move_task_area(1) # self.op_task_execute(1) # - # self.find_obj("CoffeeCup") + self.find_obj("Plate") # - # self.move_task_area(16, obj_id=275) - # self.op_task_execute(16, obj_id=275) - # pos = [-70.0, 500.0, 107] + id = 158 + self.move_task_area(16, obj_id=id) + self.op_task_execute(16, obj_id=id) + # pos = [-70.0, 500.0, 107] # 107 98 # self.move_task_area(17, release_pos=pos) # self.op_task_execute(17, release_pos=pos) # From e89677a89e39f708cf156df66b98be47628ff908 Mon Sep 17 00:00:00 2001 From: Netceor <45135347+Netceor@users.noreply.github.com> Date: Wed, 22 Nov 2023 21:21:05 +0800 Subject: [PATCH 3/4] Update VLM.py --- tasks/VLM/VLM.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks/VLM/VLM.py b/tasks/VLM/VLM.py index 642753d..1dab37d 100644 --- a/tasks/VLM/VLM.py +++ b/tasks/VLM/VLM.py @@ -112,11 +112,11 @@ class SceneVLM(Scene): # self.move_task_area(1) # self.op_task_execute(1) # - self.find_obj("Plate") - # - id = 158 - self.move_task_area(16, obj_id=id) - self.op_task_execute(16, obj_id=id) + # self.find_obj("Plate") + # # + # id = 158 + # self.move_task_area(16, obj_id=id) + # self.op_task_execute(16, obj_id=id) # pos = [-70.0, 500.0, 107] # 107 98 # self.move_task_area(17, release_pos=pos) # self.op_task_execute(17, release_pos=pos) From 58a87fa97c3cd6c499b82611d083e443f1bb3e86 Mon Sep 17 00:00:00 2001 From: Caiyishuai <39987654+Caiyishuai@users.noreply.github.com> Date: Wed, 22 Nov 2023 23:06:40 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E8=AE=B8?= =?UTF-8?q?=E5=A4=9A=E5=9C=BA=E6=99=AF=E4=B8=AD=E8=83=BD=E6=8A=93=E5=8F=96?= =?UTF-8?q?=E7=9A=84=E9=A5=AE=E6=96=99=EF=BC=8C=E5=88=9D=E5=A7=8B=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E4=B8=B0=E5=AF=8C=E4=BA=86=E7=89=A9=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robowaiter/behavior_lib/_base/Behavior.py | 8 ++- robowaiter/behavior_lib/act/PutDown.py | 3 + robowaiter/scene/scene.py | 70 +++++++++++++++++++---- tasks/VLM/VLM.py | 12 ++-- 4 files changed, 73 insertions(+), 20 deletions(-) diff --git a/robowaiter/behavior_lib/_base/Behavior.py b/robowaiter/behavior_lib/_base/Behavior.py index e704d5a..7051e10 100644 --- a/robowaiter/behavior_lib/_base/Behavior.py +++ b/robowaiter/behavior_lib/_base/Behavior.py @@ -15,8 +15,12 @@ class Bahavior(ptree.behaviour.Behaviour): scene = None print_name_prefix = "" tables_for_placement = {'Bar', 'Bar2', 'WaterTable', 'CoffeeTable', 'Table1', 'Table2', 'Table3',"BrightTable6"} - all_object = {'Coffee', 'Water', 'Dessert', 'Softdrink', 'BottledDrink', 'Yogurt', 'ADMilk', 'MilkDrink', 'Milk', - 'VacuumCup'} + # all_object = {'Coffee', 'Water', 'Dessert', 'Softdrink', 'BottledDrink', 'Yogurt', 'ADMilk', 'MilkDrink', 'Milk', + # 'VacuumCup'} + + all_object = { + 'Coffee', 'Water', 'Dessert', 'Softdrink', 'BottledDrink', 'Yogurt', 'ADMilk', 'MilkDrink', 'Milk','VacuumCup', + 'Chips', 'NFCJuice', 'Bernachon', 'ADMilk', 'SpringWater'} # BrightTable5 = Table4 tables_for_guiding = {"QuietTable1","QuietTable2", diff --git a/robowaiter/behavior_lib/act/PutDown.py b/robowaiter/behavior_lib/act/PutDown.py index 5bd74a9..2c30ab6 100644 --- a/robowaiter/behavior_lib/act/PutDown.py +++ b/robowaiter/behavior_lib/act/PutDown.py @@ -48,6 +48,9 @@ class PutDown(Act): Act.num_of_obj_on_place[self.target_place]+=1 self.scene.move_task_area(op_type, release_pos=release_pos) + + if self.target_obj == "Chips": + release_pos[2] +=3 self.scene.op_task_execute(op_type, release_pos=release_pos) if self.scene.take_picture: self.scene.get_obstacle_point(self.scene.db, self.status, map_ratio=self.scene.map_ratio,update_info_count=1) diff --git a/robowaiter/scene/scene.py b/robowaiter/scene/scene.py index 2d72640..2623f39 100644 --- a/robowaiter/scene/scene.py +++ b/robowaiter/scene/scene.py @@ -88,6 +88,8 @@ class Scene: 'Exist(Softdrink)', # 'On(Yogurt,Bar)','On(BottledDrink,Bar)', # 'Exist(Softdrink)', 'On(Softdrink,Table1)', + '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)'}, @@ -793,25 +795,68 @@ class Scene: scene = self.status ginger_loc = [scene.location.X, scene.location.Y, scene.location.Z] obj_list = [ + + GrabSim_pb2.ObjectList.Object(x=190, y=40, z=87, roll=0, pitch=0, yaw=0, + type=38), #矿泉水 + + + GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 75, z=95, roll=0, pitch=0, yaw=0, + type=48), # 48是薯片 + # GrabSim_pb2.ObjectList.Object(x=190, y=40, z=87, roll=0, pitch=0, yaw=0, + # type=48), #48是薯片 + GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 65, z=95, roll=0, pitch=0, yaw=0, + type=37), #37是NFC果汁 + GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 55, z=95, roll=0, pitch=0, yaw=0, + type=8), #8是贝尔纳松 + GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 45, z=95, roll=0, pitch=0, yaw=0, + type=6), #6是AD钙奶 + GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 35, z=95, roll=0, pitch=0, yaw=0, + type=9), #9是冰红(瓶) + GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 25, z=95, roll=0, pitch=0, yaw=0, + type=5), # 5是酸奶 + + # GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 30, z=95, roll=0, pitch=0, yaw=0, + # type=13), # GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 40, z=95, roll=0, pitch=0, yaw=0, - # type=5), #48是薯片,6是AD钙奶 - GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 40, z=95, roll=0, pitch=0, yaw=0, - type=57), - # GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 50, y=ginger_loc[1] - 40, z=h, roll=0, pitch=0, yaw=0, type=9), + # type=48), # GrabSim_pb2.ObjectList.Object(x=340, y=960, z=88, roll=0, pitch=0, yaw=90, type=7), # GrabSim_pb2.ObjectList.Object(x=340, y=960, z = 88, roll=0, pitch=0, yaw=90, type=9), + GrabSim_pb2.ObjectList.Object(x=320, y=400, z=95, roll=0, pitch=0, yaw=0, + type=20), + # 斜桌三瓶冰红茶 GrabSim_pb2.ObjectList.Object(x=340, y=965, z=88, roll=0, pitch=0, yaw=90, type=4), GrabSim_pb2.ObjectList.Object(x=320, y=940, z=88, roll=0, pitch=0, yaw=90, type=4), GrabSim_pb2.ObjectList.Object(x=300, y=930, z=88, roll=0, pitch=0, yaw=90, type=4), + # GrabSim_pb2.ObjectList.Object(x=300, y=930, z=88, roll=0, pitch=0, yaw=90, type=38), #矿泉水 + GrabSim_pb2.ObjectList.Object(x=370, y=1000, z=88, roll=0, pitch=0, yaw=90, type=1), #香蕉 + GrabSim_pb2.ObjectList.Object(x=380, y=1000, z=88, roll=0, pitch=0, yaw=90, type=65), # 番茄 + GrabSim_pb2.ObjectList.Object(x=380, y=1020, z=88, roll=0, pitch=0, yaw=90, type=42), # 山竹 + GrabSim_pb2.ObjectList.Object(x=360, y=1020, z=88, roll=0, pitch=0, yaw=90, type=27), # 橙子 + + # BrightTable2 + # GrabSim_pb2.ObjectList.Object(x=-30, y=1000, z=35, roll=0, pitch=0, yaw=90, type=64), #西瓜 + GrabSim_pb2.ObjectList.Object(x=-15, y=1050, z=40, roll=0, pitch=0, yaw=90, type=17), #a午餐盒 + + # 保温杯 GrabSim_pb2.ObjectList.Object(x=-102, y=10, z=90, roll=0, pitch=0, yaw=90, type=7), # GrabSim_pb2.ObjectList.Object(x=ginger_loc[0] - 55, y=ginger_loc[1] - 70, z=95, roll=0, pitch=0, yaw=0, # type=9), + + # Table3上由两套军旗,一个模仿 GrabSim_pb2.ObjectList.Object(x=-115, y=200, z=85, roll=0, pitch=0, yaw=90, type=26), # Chess + GrabSim_pb2.ObjectList.Object(x=-130, y=225, z=85, roll=0, pitch=0, yaw=90, type=55), # 玩具狗 + GrabSim_pb2.ObjectList.Object(x=-110, y=225, z=85, roll=0, pitch=0, yaw=90, type=56), #玩具熊 GrabSim_pb2.ObjectList.Object(x=-115, y=250, z=85, roll=0, pitch=0, yaw=90, type=26), # Chess - GrabSim_pb2.ObjectList.Object(x=-115, y=280, z=85, roll=0, pitch=0, yaw=90, type=35), # Chess + GrabSim_pb2.ObjectList.Object(x=-115, y=280, z=85, roll=0, pitch=0, yaw=90, type=35), # 魔方 + + # 靠窗边的桌子上 + GrabSim_pb2.ObjectList.Object(x=-400, y=520, z=70, roll=0, pitch=0, yaw=0, type=63), # 小说 + GrabSim_pb2.ObjectList.Object(x=-410, y=550, z=70, roll=0, pitch=0, yaw=0, type=59), # 围巾 + GrabSim_pb2.ObjectList.Object(x=-395, y=570, z=70, roll=0, pitch=0, yaw=0, type=18), # 手镯 + ] scene = stub.AddObjects(GrabSim_pb2.ObjectList(objects=obj_list, scene=self.sceneID)) @@ -823,13 +868,13 @@ class Scene: scene = self.status # 低头 - # value = [0] * 21 - # for i in range(21): - # value[i] = self.status.joints[i].angle - # value[5] = 30 - # action = GrabSim_pb2.Action(scene=self.sceneID, action=GrabSim_pb2.Action.ActionType.RotateJoints, values=value) - # scene = stub.Do(action) - # time.sleep(1.0) + value = [0] * 21 + for i in range(21): + value[i] = self.status.joints[i].angle + value[5] = 30 + action = GrabSim_pb2.Action(scene=self.sceneID, action=GrabSim_pb2.Action.ActionType.RotateJoints, values=value) + scene = stub.Do(action) + time.sleep(1.0) if self.take_picture: self.get_obstacle_point(self.db, self.status, map_ratio=self.map_ratio) @@ -916,6 +961,7 @@ class Scene: # 执行过程: Robot输出"开始(任务名)" -> 按步骤数执行任务 -> Robot输出成功或失败的对话 def op_task_execute(self, op_type, obj_id=0, release_pos=[247.0, 520.0, 100.0]): + #id = 196 # Glass = 188+x, Plate = 150+x self.control_robot_action(0, 1, "开始" + self.op_dialog[op_type]) # 输出正在执行的任务 if op_type < 8: if self.take_picture: diff --git a/tasks/VLM/VLM.py b/tasks/VLM/VLM.py index 1dab37d..56d4747 100644 --- a/tasks/VLM/VLM.py +++ b/tasks/VLM/VLM.py @@ -114,12 +114,12 @@ class SceneVLM(Scene): # # self.find_obj("Plate") # # - # id = 158 - # self.move_task_area(16, obj_id=id) - # self.op_task_execute(16, obj_id=id) - # pos = [-70.0, 500.0, 107] # 107 98 - # self.move_task_area(17, release_pos=pos) - # self.op_task_execute(17, release_pos=pos) + id = 0 + self.move_task_area(16, obj_id=id) + self.op_task_execute(16, obj_id=id) + pos = [-70.0, 500.0, 111] # 107 98 + self.move_task_area(17, release_pos=pos) + self.op_task_execute(17, release_pos=pos) # # # 倒水:倒完的水放到旁边桌子上 # self.move_task_area(2)