增加AEM的测试
This commit is contained in:
parent
ce6d83f3d5
commit
3f1f8d9d06
|
@ -8,4 +8,9 @@ class ExploreEnv(Act):
|
||||||
super().__init__(*args)
|
super().__init__(*args)
|
||||||
|
|
||||||
def _update(self) -> ptree.common.Status:
|
def _update(self) -> ptree.common.Status:
|
||||||
return ptree.common.Status.SUCCESS
|
# explore algorithm
|
||||||
|
|
||||||
|
|
||||||
|
self.scene.state["condition_set"].add("EnvExplored()")
|
||||||
|
|
||||||
|
return ptree.common.Status.RUNNING
|
||||||
|
|
|
@ -2,13 +2,21 @@ 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 HasMap(Cond):
|
class EnvExplored(Cond):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def _update(self) -> ptree.common.Status:
|
def _update(self) -> ptree.common.Status:
|
||||||
# if self.scene.status?
|
arg_str = self.arg_str
|
||||||
if self.scene.state['map']['2d'] == None:
|
|
||||||
return ptree.common.Status.FAILURE
|
if f'EnvExplored()' not in self.scene.state["condition_set"]:
|
||||||
else:
|
|
||||||
return ptree.common.Status.SUCCESS
|
return ptree.common.Status.SUCCESS
|
||||||
|
else:
|
||||||
|
return ptree.common.Status.FAILURE
|
||||||
|
|
||||||
|
|
||||||
|
# if self.scene.status?
|
||||||
|
# if self.scene.state['map']['2d'] == None:
|
||||||
|
# return ptree.common.Status.FAILURE
|
||||||
|
# else:
|
||||||
|
# return ptree.common.Status.SUCCESS
|
|
@ -98,7 +98,6 @@ class ptmlTranslator(ptmlListener):
|
||||||
#
|
#
|
||||||
# tag = "cond_" + short_uuid() if node_type == "cond" else "task_" + short_uuid()
|
# tag = "cond_" + short_uuid() if node_type == "cond" else "task_" + short_uuid()
|
||||||
|
|
||||||
print(f'create node: {name}({args})')
|
|
||||||
node = eval(f"{name}({args})")
|
node = eval(f"{name}({args})")
|
||||||
node.set_scene(self.scene)
|
node.set_scene(self.scene)
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"测试VLM:做一杯咖啡": {"Answer": " 测试VLM:做一杯咖啡", "Goal": "{\"At(Coffee,Bar)\"}"}, "测试VLN:前往桌子": {"Answer": "测试VLN:前往桌子", "Goal": "{\"At(Robot,Table)\"}"}}
|
{"测试VLM:做一杯咖啡": {"Answer": "测试VLM:做一杯咖啡", "Goal": "{\"At(Coffee,Bar)\"}"}, "测试VLN:前往桌子": {"Answer": "测试VLN:前往桌子", "Goal": "{\"At(Robot,Table)\"}"}, "测试AEM": {"Answer": "测试AEM", "Goal": "{\"EnvExplored()\"}"}}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
Question,Answer,Goal
|
Question,Answer,Goal
|
||||||
测试VLM:做一杯咖啡,测试VLM:做一杯咖啡,"{""At(Coffee,Bar)""}"
|
测试VLM:做一杯咖啡,测试VLM:做一杯咖啡,"{""At(Coffee,Bar)""}"
|
||||||
测试VLN:前往桌子,测试VLN:前往桌子,"{""At(Robot,Table)""}"
|
测试VLN:前往桌子,测试VLN:前往桌子,"{""At(Robot,Table)""}"
|
||||||
|
²âÊÔAEM,²âÊÔAEM,"{""EnvExplored()""}"
|
||||||
|
|
|
|
@ -1,6 +1,6 @@
|
||||||
selector
|
selector
|
||||||
// selector
|
// sequence
|
||||||
// cond HasMap()
|
// cond NeedExplore()
|
||||||
// act ExploreEnv()
|
// act ExploreEnv()
|
||||||
sequence
|
sequence
|
||||||
cond Chatting()
|
cond Chatting()
|
||||||
|
@ -8,5 +8,4 @@ selector
|
||||||
sequence
|
sequence
|
||||||
cond HasSubTask()
|
cond HasSubTask()
|
||||||
sequence
|
sequence
|
||||||
act SubTaskPlaceHolder()
|
act SubTaskPlaceHolder()
|
||||||
cond At(Talb,ea)
|
|
|
@ -10,6 +10,4 @@ selector
|
||||||
cond HasSubTask()
|
cond HasSubTask()
|
||||||
sequence
|
sequence
|
||||||
{
|
{
|
||||||
act SubTaskPlaceHolder()
|
act SubTaskPlaceHolder()}}}
|
||||||
|
|
||||||
} cond At(Talb,ea)}}
|
|
|
@ -73,6 +73,8 @@ class Robot(object):
|
||||||
add={'At(Coffee,Bar)'}, del_set=set(), cost=1),
|
add={'At(Coffee,Bar)'}, del_set=set(), cost=1),
|
||||||
Action(name='MoveTo(Table)', pre={'At(Robot,Bar)'},
|
Action(name='MoveTo(Table)', pre={'At(Robot,Bar)'},
|
||||||
add={'At(Robot,Table)'}, del_set=set(), cost=1),
|
add={'At(Robot,Table)'}, del_set=set(), cost=1),
|
||||||
|
Action(name='ExploreEnv()', pre={'At(Robot,Bar)'},
|
||||||
|
add={'EnvExplored()'}, del_set=set(), cost=1),
|
||||||
]
|
]
|
||||||
return action_list
|
return action_list
|
||||||
|
|
||||||
|
|
|
@ -8,20 +8,6 @@ from robowaiter.scene.scene import Scene
|
||||||
class SceneAEM(Scene):
|
class SceneAEM(Scene):
|
||||||
def __init__(self, robot):
|
def __init__(self, robot):
|
||||||
super().__init__(robot)
|
super().__init__(robot)
|
||||||
|
self.event_list = [
|
||||||
# control.init_world(1, 3)
|
(5, self.create_chat_event("测试AEM")),
|
||||||
|
]
|
||||||
def _reset(self):
|
|
||||||
self.add_object(0, 570, 1600, 85.5) # type与物品编号对应,具体参考README.md
|
|
||||||
self.add_object(1, 570, 1630, 85.5)
|
|
||||||
self.add_object(2, 570, 1660, 85.5)
|
|
||||||
self.add_object(3, 580, 1680, 85.5)
|
|
||||||
|
|
||||||
# todo: 探索并获得语义地图
|
|
||||||
print(self.status.objects) # 全部的物品信息,包括名称、位置等,与获得的语义地图进行对比
|
|
||||||
|
|
||||||
def _run(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def _step(self):
|
|
||||||
pass
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
from robowaiter import Robot, task_map
|
from robowaiter import Robot, task_map
|
||||||
|
|
||||||
TASK_NAME = 'VLN'
|
TASK_NAME = 'AEM'
|
||||||
|
|
||||||
# create robot
|
# create robot
|
||||||
project_path = "./robowaiter"
|
project_path = "./robowaiter"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
selector{
|
selector{
|
||||||
cond At(Robot,Table)
|
cond EnvExplored()
|
||||||
selector{
|
selector{
|
||||||
cond At(Robot,Bar)
|
cond At(Robot,Bar)
|
||||||
act MoveTo(Table)
|
act ExploreEnv()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue