修复斜桌抓握问题

This commit is contained in:
Netceor 2023-11-22 20:13:44 +08:00
parent ae5dc2222e
commit c1019ffb77
3 changed files with 15 additions and 6 deletions

View File

@ -189,4 +189,8 @@ get_object_info
我带着孩子呢,想要宽敞亮堂的地方。
好的,我明白了,那么我们推荐您到大厅的桌子,那里的空间比较宽敞,环境也比较明亮,适合带着孩子一起用餐。
冰红茶
好的
create_sub_task
{"goal":"On(Softdrink,Bar)"}

View File

@ -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

View File

@ -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)"))