RoboWaiter/tasks_no_ui/Interact/system.py

40 lines
806 B
Python
Raw Normal View History

2023-11-16 20:48:01 +08:00
"""
2023-11-21 09:06:50 +08:00
交互式场景输入
2023-11-16 20:48:01 +08:00
"""
# todo: 接收点单信息,大模型生成任务规划
from robowaiter.scene.scene import Scene
class SubScene(Scene):
def __init__(self, robot):
super().__init__(robot)
# 在这里加入场景中发生的事件
def _reset(self):
pass
def _step(self):
if len(self.sub_task_seq.children) == 0:
question = input("请输入指令:")
if question[-1] == ")":
print(f"设置目标:{question}")
2023-11-21 09:06:50 +08:00
self.new_set_goal(question)
2023-11-16 20:48:01 +08:00
else:
2023-11-21 09:06:50 +08:00
self.customer_say("System",question)
2023-11-16 20:48:01 +08:00
if __name__ == '__main__':
from robowaiter.robot.robot import Robot
robot = Robot()
# create task
task = SubScene(robot)
task.reset()
task.run()