导航修改
This commit is contained in:
parent
39f416acea
commit
1c1b229ddb
|
@ -7,7 +7,7 @@ import pickle
|
||||||
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from robowaiter.scene import scene
|
# from robowaiter.scene import scene
|
||||||
|
|
||||||
from robowaiter.algos.navigator.dstar_lite import DStarLite, euclidean_distance
|
from robowaiter.algos.navigator.dstar_lite import DStarLite, euclidean_distance
|
||||||
|
|
||||||
|
|
|
@ -2,17 +2,18 @@ import py_trees as ptree
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from robowaiter.behavior_lib._base.Cond import Cond
|
from robowaiter.behavior_lib._base.Cond import Cond
|
||||||
|
|
||||||
class EnvExplored(Cond):
|
class NeedExplore(Cond):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def _update(self) -> ptree.common.Status:
|
def _update(self) -> ptree.common.Status:
|
||||||
arg_str = self.arg_str
|
# arg_str = self.arg_str
|
||||||
|
#
|
||||||
if f'EnvExplored()' not in self.scene.state["condition_set"]:
|
# if f'EnvExplored()' not in self.scene.state["condition_set"]:
|
||||||
return ptree.common.Status.SUCCESS
|
# return ptree.common.Status.SUCCESS
|
||||||
else:
|
# else:
|
||||||
return ptree.common.Status.FAILURE
|
# return ptree.common.Status.FAILURE
|
||||||
|
return ptree.common.Status.FAILURE
|
||||||
|
|
||||||
|
|
||||||
# if self.scene.status?
|
# if self.scene.status?
|
|
@ -15,6 +15,9 @@ selector
|
||||||
cond At(Robot,Bar)
|
cond At(Robot,Bar)
|
||||||
act MoveTo(Bar)
|
act MoveTo(Bar)
|
||||||
act GreetCustomer()
|
act GreetCustomer()
|
||||||
|
sequence
|
||||||
|
cond NeedExplore()
|
||||||
|
act ExploreEnv()
|
||||||
sequence
|
sequence
|
||||||
cond AnomalyDetected()
|
cond AnomalyDetected()
|
||||||
act ResolveAnomaly()
|
act ResolveAnomaly()
|
||||||
|
|
|
@ -23,6 +23,10 @@ selector
|
||||||
act MoveTo(Bar)
|
act MoveTo(Bar)
|
||||||
} act GreetCustomer()
|
} act GreetCustomer()
|
||||||
} sequence
|
} sequence
|
||||||
|
{
|
||||||
|
cond NeedExplore()
|
||||||
|
act ExploreEnv()
|
||||||
|
} sequence
|
||||||
{
|
{
|
||||||
cond AnomalyDetected()
|
cond AnomalyDetected()
|
||||||
act ResolveAnomaly()
|
act ResolveAnomaly()
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 113 KiB |
|
@ -1,10 +1,23 @@
|
||||||
sequence{
|
selector
|
||||||
cond Holding(Nothing)
|
sequence
|
||||||
sequence{
|
cond Chatting()
|
||||||
cond Is(Curtain,Off)
|
act DealChat()
|
||||||
act Turn(Curtain,On)
|
sequence
|
||||||
}
|
cond HasSubTask()
|
||||||
sequence{
|
sequence
|
||||||
cond Is(AC,Off)
|
act SubTaskPlaceHolder()
|
||||||
act Turn(AC,On)
|
sequence
|
||||||
}}
|
cond FocusingCustomer()
|
||||||
|
act ServeCustomer()
|
||||||
|
sequence
|
||||||
|
cond NewCustomer()
|
||||||
|
selector
|
||||||
|
cond At(Robot,Bar)
|
||||||
|
act MoveTo(Bar)
|
||||||
|
act GreetCustomer()
|
||||||
|
sequence
|
||||||
|
cond NeedExplore()
|
||||||
|
act ExploreEnv()
|
||||||
|
sequence
|
||||||
|
cond AnomalyDetected()
|
||||||
|
act ResolveAnomaly()
|
||||||
|
|
|
@ -23,6 +23,10 @@ selector
|
||||||
act MoveTo(Bar)
|
act MoveTo(Bar)
|
||||||
} act GreetCustomer()
|
} act GreetCustomer()
|
||||||
} sequence
|
} sequence
|
||||||
|
{
|
||||||
|
cond NeedExplore()
|
||||||
|
act ExploreEnv()
|
||||||
|
} sequence
|
||||||
{
|
{
|
||||||
cond AnomalyDetected()
|
cond AnomalyDetected()
|
||||||
act ResolveAnomaly()
|
act ResolveAnomaly()
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
# from robowaiter.behavior_tree.ptml.ptmlCompiler import load
|
# from robowaiter.behavior_tree.ptml.ptmlCompiler import load
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from robowaiter.robot.robot import Robot
|
|
||||||
from robowaiter.utils.bt.draw import render_dot_tree
|
|
||||||
from robowaiter.utils.basic import get_root_path
|
from robowaiter.utils.basic import get_root_path
|
||||||
|
from robowaiter.utils.bt.draw import render_dot_tree
|
||||||
from robowaiter.utils.bt.load import load_bt_from_ptml
|
from robowaiter.utils.bt.load import load_bt_from_ptml
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 116 KiB |
Binary file not shown.
Loading…
Reference in New Issue