2023-11-09 08:47:57 +08:00
|
|
|
import py_trees as ptree
|
|
|
|
from typing import Any
|
|
|
|
from robowaiter.behavior_lib._base.Act import Act
|
|
|
|
from robowaiter.behavior_lib._base.Behavior import Status
|
|
|
|
|
2023-11-13 14:53:00 +08:00
|
|
|
class Make(Act):
|
|
|
|
can_be_expanded = True
|
|
|
|
num_args = 1
|
|
|
|
valid_args = (
|
|
|
|
"Coffee",
|
|
|
|
)
|
2023-11-09 08:47:57 +08:00
|
|
|
|
|
|
|
def __init__(self, *args):
|
|
|
|
super().__init__(*args)
|
2023-11-13 14:53:00 +08:00
|
|
|
self.target_obj = self.args[0]
|
|
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def get_info(cls,arg):
|
|
|
|
info = None
|
|
|
|
if arg == "Coffee":
|
|
|
|
info = {
|
|
|
|
"add": {f'On(Coffee,Table)'},
|
|
|
|
}
|
|
|
|
return info
|
2023-11-13 21:52:15 +08:00
|
|
|
|
2023-11-09 08:47:57 +08:00
|
|
|
def _update(self) -> ptree.common.Status:
|
|
|
|
op_type = 1
|
|
|
|
self.scene.move_task_area(op_type)
|
|
|
|
self.scene.op_task_execute(op_type)
|
2023-11-13 15:43:23 +08:00
|
|
|
self.scene.state["condition_set"].add(self.add)
|
2023-11-09 08:47:57 +08:00
|
|
|
return Status.RUNNING
|