RoboWaiter/ptml/ptml_test.py

22 lines
543 B
Python
Raw Normal View History

2023-10-08 15:44:59 +08:00
import os
import py_trees as ptree
2023-10-08 15:44:59 +08:00
from scene_utils import control
from ptmlCompiler import load
2023-10-08 15:44:59 +08:00
if __name__ == '__main__':
project_path = "."
2023-10-08 15:44:59 +08:00
ptml_path = os.path.join(project_path, 'CoffeeDelivery.ptml')
behavior_lib_path = os.path.join(project_path, 'behaviour_lib')
scene = control.Scene(sceneID=0)
# load
scene.load_BT(ptml_path, behavior_lib_path)
# ptree.display.render_dot_tree(bt)
# build and tick
scene.BT = ptree.trees.BehaviourTree(scene.BT)
# todo: tick this bt
print(scene.BT)