Home

Awesome

Py Trees

[About][Docs & Demos][Releases][Installation][PyTrees-Ros Ecosystem]


About

PyTrees is a python implementation of behaviour trees designed to facilitate the rapid development of medium sized decision making engines for use in fields like robotics. Brief feature list:

Documentation

devel 2.1.x 0.7.x 0.6.x

Getting Started

VSCode and a py38 DevContainer on CodeSpaces will set you up with an environment for running demos, tests and/or creating PRs in less than five minutes. If you're just looking for releases, fetch them from PyPi.

  1. Fork the project to your personal account
  2. Click on Code -> Codespaces -> + Create a Codespace
  3. Be froody
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
(docker) zen@py_trees:/workspaces/py_trees$ poetry shell

(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ py-trees-demo-<tab>-<tab>
py-trees-demo-action-behaviour            py-trees-demo-context-switching           py-trees-demo-logging
py-trees-demo-behaviour-lifecycle         py-trees-demo-display-modes               py-trees-demo-pick-up-where-you-left-off
py-trees-demo-blackboard                  py-trees-demo-dot-graphs                  py-trees-demo-selector
py-trees-demo-blackboard-namespaces       py-trees-demo-either-or                   py-trees-demo-sequence
py-trees-demo-blackboard-remappings       py-trees-demo-eternal-guard               py-trees-demo-tree-stewardship

(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ py-trees-demo-blackboard
*******************************************************************************
                                   Blackboard
*******************************************************************************

Demonstrates usage of the blackboard and related behaviours.

A sequence is populated with a few behaviours that exercise
reading and writing on the Blackboard in interesting ways.

*******************************************************************************

[DEBUG] Writer               : BlackboardWriter.__init__()
...
...

If you're really looking for something more edifying than hello world examples, walk through the ros tutorials which incrementally step through the process of building a scenario handling layer for a robot.

There are also runtime visualisation tools - refer to the py_trees_ros_viewer/README as an example implementation of the underlying py_trees_js library.

Releases

Devel2.1.x2.0.x1.2.x0.7.x0.6.x
Sourcesdevel2.1.x2.0.x1.2.x0.7.x0.6.x
CompatibilityPython 3.6Python 3.6Python 3.6Python 3.6Python 3.6Python 2.7
CIdevel-Status2.1.x-Status2.0.x-Status1.2.x-Status0.7.x-Status0.6.x-Status
Documentationdevel-Docs2.1.x-Docs2.0.x-Docs1.2.x-Docs0.7.x-Docs0.6.x-Docs

Installation

From ppa on Ubuntu/Bionic:

$ sudo apt install python3-py-trees

From pypi:

$ pip3 install py_trees

In a Python Virtual Environment:

$ git clone https://github.com/splintered-reality/py_trees
$ cd py_trees
$ source ./venv.bash

Build your own python3 deb:

$ git clone https://github.com/splintered-reality/py_trees
$ cd py_trees
$ source ./venv.bash
$ make deb

From the ROS2 ecosystem:

$ sudo apt install ros-<rosdistro>-py-trees

PyTrees-ROS Ecosystem

See the py_trees_ros README for the latest information on pytrees packages in the ROS ecosystem and their status.

Developers

Documentation

# Build Locally
$ make -C docs html

# ReadTheDocs requirements
$ poetry export -f requirements.txt --with docs -o docs/requirements.txt