2023-11-18 14:51:17 +08:00
|
|
|
import py_trees as ptree
|
|
|
|
from typing import Any
|
|
|
|
from robowaiter.behavior_lib._base.Cond import Cond
|
|
|
|
|
|
|
|
class FocusingCustomer(Cond):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
|
|
|
|
|
|
|
|
def _update(self) -> ptree.common.Status:
|
|
|
|
# if self.scene.status?
|
|
|
|
if "customer" in self.scene.state['attention']:
|
2023-11-20 11:12:36 +08:00
|
|
|
if self.scene.take_picture:
|
|
|
|
self.scene.get_obstacle_point(self.scene.db, self.status, map_ratio=self.scene.map_ratio)
|
2023-11-18 14:51:17 +08:00
|
|
|
return ptree.common.Status.SUCCESS
|
|
|
|
else:
|
2023-11-19 21:48:02 +08:00
|
|
|
goal = Cond.place_xy_yaw_dic['Bar']
|
|
|
|
self.scene.walk_to(goal[0] - 5, goal[1], 180, 180, 0)
|
2023-11-18 14:51:17 +08:00
|
|
|
return ptree.common.Status.FAILURE
|