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