{"library":"py-trees","title":"py_trees","description":"A pythonic implementation of behaviour trees for building hierarchical decision-making systems. Currently at version 2.4.0, with support for Python 3.9+ and ROS 2 Humble/Jazzy. Released roughly every 6-12 months.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install py-trees"],"cli":null},"imports":["from py_trees.behaviour import Behaviour","from py_trees.composites import Sequence","from py_trees.composites import Selector","from py_trees.composites import Parallel","from py_trees.common import Running","from py_trees.console import create_tree"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import py_trees\n\n# Create a simple sequence tree\nroot = py_trees.composites.Sequence(name=\"Root\", memory=True)\nmove = py_trees.behaviours.SuccessEveryN(name=\"Move\", n=5)\nwait = py_trees.behaviours.Running(name=\"Wait\")\nroot.add_children([move, wait])\n\n# Create the tree\npy_trees.trees.BehaviourTree(root)\n\n# Tick the tree\nfor i in range(3):\n    root.tick_once()\n    print(f\"Tick {i}: {root.status}\")","lang":"python","description":"Creates a simple sequence with two behaviours and ticks it.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}