RoboWaiter/BTExpansionCode/EXP/behavior_lib/cond/Holding.py

28 lines
790 B
Python
Raw Normal View History

2024-01-04 22:51:33 +08:00
import py_trees as ptree
from typing import Any
from EXP.behavior_lib._base.Cond import Cond
class Holding(Cond):
can_be_expanded = True
2024-04-10 19:59:13 +08:00
num_params = 1
valid_args = tuple(Cond.all_object|{'Nothing'})
2024-01-04 22:51:33 +08:00
def __init__(self,*args):
super().__init__(*args)
def _update(self) -> ptree.common.Status:
# if self.scene.status?
# self.scene.get_obstacle_point(self.scene.db, self.status, map_ratio=self.scene.map_ratio)
if self.name in self.scene.state["condition_set"]:
return ptree.common.Status.SUCCESS
else:
return ptree.common.Status.FAILURE
# if self.scene.state['chat_list'] == []:
# return ptree.common.Status.FAILURE
# else:
# return ptree.common.Status.SUCCESS