2023-11-08 10:03:40 +08:00
|
|
|
import py_trees as ptree
|
|
|
|
from typing import Any
|
2023-11-08 15:28:01 +08:00
|
|
|
from robowaiter.behavior_lib._base.Cond import Cond
|
2023-11-14 12:09:53 +08:00
|
|
|
import itertools
|
2023-11-08 10:03:40 +08:00
|
|
|
|
2023-11-08 15:28:01 +08:00
|
|
|
class At(Cond):
|
|
|
|
can_be_expanded = True
|
2023-11-08 10:03:40 +08:00
|
|
|
num_params = 2
|
2023-11-14 12:09:53 +08:00
|
|
|
|
2023-11-17 18:56:58 +08:00
|
|
|
valid_args = list(itertools.product(('Robot','Customer'), tuple(Cond.all_object | Cond.tables_for_placement | Cond.tables_for_guiding | {'Customer'})))
|
2023-11-14 12:09:53 +08:00
|
|
|
valid_args.remove(('Customer','Customer'))
|
|
|
|
valid_args = tuple(valid_args)
|
2023-11-08 10:03:40 +08:00
|
|
|
|
|
|
|
def __init__(self,*args):
|
|
|
|
super().__init__(*args)
|
|
|
|
|
|
|
|
|
|
|
|
def _update(self) -> ptree.common.Status:
|
|
|
|
# if self.scene.status?
|
2023-11-09 08:47:57 +08:00
|
|
|
|
2023-11-20 11:12:36 +08:00
|
|
|
# self.scene.get_obstacle_point(self.scene.db, self.status, map_ratio=self.scene.map_ratio)
|
|
|
|
|
2023-11-14 12:09:53 +08:00
|
|
|
if self.name in self.scene.state["condition_set"]:
|
2023-11-08 10:03:40 +08:00
|
|
|
return ptree.common.Status.SUCCESS
|
2023-11-09 08:47:57 +08:00
|
|
|
else:
|
|
|
|
return ptree.common.Status.FAILURE
|
|
|
|
|
|
|
|
# if self.scene.state['chat_list'] == []:
|
|
|
|
# return ptree.common.Status.FAILURE
|
|
|
|
# else:
|
|
|
|
# return ptree.common.Status.SUCCESS
|