增加AEM的测试
This commit is contained in:
parent
ce6d83f3d5
commit
3f1f8d9d06
|
@ -8,4 +8,9 @@ class ExploreEnv(Act):
|
|||
super().__init__(*args)
|
||||
|
||||
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 robowaiter.behavior_lib._base.Cond import Cond
|
||||
|
||||
class HasMap(Cond):
|
||||
class EnvExplored(Cond):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def _update(self) -> ptree.common.Status:
|
||||
# if self.scene.status?
|
||||
if self.scene.state['map']['2d'] == None:
|
||||
return ptree.common.Status.FAILURE
|
||||
else:
|
||||
arg_str = self.arg_str
|
||||
|
||||
if f'EnvExplored()' not in self.scene.state["condition_set"]:
|
||||
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()
|
||||
|
||||
print(f'create node: {name}({args})')
|
||||
node = eval(f"{name}({args})")
|
||||
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
|
||||
测试VLM:做一杯咖啡,测试VLM:做一杯咖啡,"{""At(Coffee,Bar)""}"
|
||||
测试VLN:前往桌子,测试VLN:前往桌子,"{""At(Robot,Table)""}"
|
||||
²âÊÔAEM,²âÊÔAEM,"{""EnvExplored()""}"
|
||||
|
|
|
|
@ -1,6 +1,6 @@
|
|||
selector
|
||||
// selector
|
||||
// cond HasMap()
|
||||
// sequence
|
||||
// cond NeedExplore()
|
||||
// act ExploreEnv()
|
||||
sequence
|
||||
cond Chatting()
|
||||
|
@ -8,5 +8,4 @@ selector
|
|||
sequence
|
||||
cond HasSubTask()
|
||||
sequence
|
||||
act SubTaskPlaceHolder()
|
||||
cond At(Talb,ea)
|
||||
act SubTaskPlaceHolder()
|
|
@ -10,6 +10,4 @@ selector
|
|||
cond HasSubTask()
|
||||
sequence
|
||||
{
|
||||
act SubTaskPlaceHolder()
|
||||
|
||||
} cond At(Talb,ea)}}
|
||||
act SubTaskPlaceHolder()}}}
|
|
@ -73,6 +73,8 @@ class Robot(object):
|
|||
add={'At(Coffee,Bar)'}, del_set=set(), cost=1),
|
||||
Action(name='MoveTo(Table)', pre={'At(Robot,Bar)'},
|
||||
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
|
||||
|
||||
|
|
|
@ -8,20 +8,6 @@ from robowaiter.scene.scene import Scene
|
|||
class SceneAEM(Scene):
|
||||
def __init__(self, robot):
|
||||
super().__init__(robot)
|
||||
|
||||
# control.init_world(1, 3)
|
||||
|
||||
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
|
||||
self.event_list = [
|
||||
(5, self.create_chat_event("测试AEM")),
|
||||
]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
from robowaiter import Robot, task_map
|
||||
|
||||
TASK_NAME = 'VLN'
|
||||
TASK_NAME = 'AEM'
|
||||
|
||||
# create robot
|
||||
project_path = "./robowaiter"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
selector{
|
||||
cond At(Robot,Table)
|
||||
cond EnvExplored()
|
||||
selector{
|
||||
cond At(Robot,Bar)
|
||||
act MoveTo(Table)
|
||||
act ExploreEnv()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue