RoboWaiter/robowaiter/scene/tasks/VLM.py

60 lines
2.9 KiB
Python
Raw Normal View History

"""
视觉语言操作
机器人根据指令人的指令调节空调自主探索环境导航到目标点通过手臂的运动规划能力操作空调比如开关按钮调温按钮显示面板
"""
import time
from robowaiter.scene.scene import Scene
class SceneVLM(Scene):
def __init__(self, robot):
super().__init__(robot)
2023-11-09 08:47:57 +08:00
# 在这里加入场景中发生的事件, (事件发生的时间,事件函数)
self.event_list = [
2023-11-14 19:30:06 +08:00
(5, self.create_chat_event("测试VLM做一杯咖啡")),
2023-11-13 22:14:55 +08:00
# (5, self.create_chat_event("测试VLM倒一杯水")),
2023-11-14 17:04:26 +08:00
# (5, self.create_chat_event("测试VLM开空调")),
# (5, self.create_chat_event("测试VLM关空调")),
# (5, self.create_chat_event("测试VLM开大厅灯")),
2023-11-14 19:30:06 +08:00
# (5, self.create_chat_event("测试VLM拖地")),
2023-11-14 17:04:26 +08:00
# (5, self.create_chat_event("测试VLM擦桌子")),
# (5, self.create_chat_event("测试VLM整理椅子")),
# (5, self.create_chat_event("测试VLM把冰红茶放到Table2")),
# (5, self.create_chat_event("测试VLM关大厅灯"))
2023-11-14 23:16:48 +08:00
# (5, self.create_chat_event("测试VLM做一杯咖啡放到吧台上")),
2023-11-09 08:47:57 +08:00
]
2023-10-25 22:12:15 +08:00
def _reset(self):
2023-11-14 17:04:26 +08:00
self.state["condition_set"] = {'At(Robot,Bar)','Is(AC,Off)', 'Holding(Nothing)', # 'Holding(Yogurt)', #'Holding(Nothing)',
'Is(HallLight,Off)','Is(TubeLight,On)','Is(Curtain,On)',
'Is(Table1,Dirty)','Is(Floor,Dirty)','Is(Chairs,Dirty)'}
# self.gen_obj(type=5)
2023-11-14 23:16:48 +08:00
# self.gen_obj(type=9)
2023-11-14 17:04:26 +08:00
# self.op_task_execute(op_type=16, obj_id=0)
# self.move_task_area(op_type=4)
pass
2023-11-14 17:04:26 +08:00
def _run(self, op_type=10):
# 共17个操作
# "制作咖啡","倒水","夹点心","拖地","擦桌子","开筒灯","搬椅子", # 1-7
# "关筒灯","开大厅灯","关大厅灯","关闭窗帘","打开窗帘", # 8-12
# "调整空调开关","调高空调温度","调低空调温度", # 13-15
# "抓握物体","放置物体" # 16-17
# 16: 抓操作需要传入物品id17: 放操作需要传入放置位置周围的空地区域(桌边而不是桌上)
# if op_type == 16:
# self.gen_obj()
2023-11-14 14:55:07 +08:00
# self.op_task_execute(op_type, obj_id=0)
# # 原始吧台处:[247.0, 520.0, 100.0], 空调开关旁吧台:[240.0, 40.0, 70.0], 水杯桌:[-70.0, 500.0, 107]
2023-11-14 14:55:07 +08:00
# # 桌子1:[-55.0, 0.0, 107],桌子2:[-55.0, 150.0, 107], 抹布桌:[340.0, 900.0, 98.0]
# if op_type == 17: self.op_task_execute(op_type, release_pos=[340.0, 900.0, 99.0]) #[325.0, 860.0, 100]
2023-11-14 14:41:02 +08:00
# if op_type not in [16,17]:
2023-11-09 16:07:02 +08:00
# self.move_task_area(op_type)
# self.op_task_execute(op_type)
2023-11-09 16:07:02 +08:00
pass
2023-10-25 22:12:15 +08:00
def _step(self):
2023-11-09 08:47:57 +08:00
pass