Package Summary
Tags | No category tags. |
Version | 2.2.3 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/2.2.x |
Last Updated | 2023-02-08 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases] [Developers]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2023-01-28] The [2.2.x Release][new-2.2.x] is out! Sequences and Selectors with AND without memory.
- [2023-01-28] Get Started with py_trees in under 5mins.
- [2023-01-28] This is now a
poetry
project with configuration governed bypyproject.toml
.- The vestigial
setup.py
is only to assist distribution where PEP-517 is not yet well supported.
- The vestigial
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x] [![0.7.x][docs-0.7.x-image]][docs-0.7.x] [![0.6.x][docs-0.6.x-image]][docs-0.6.x]
Getting Started
You can get started on CodeSpaces (with no mismatched environment issues and in under 5mins) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(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
...
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py38 py310 format check mypy38 mypy310
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py38
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed. If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.2.x | 2.1.x | 2.0.x | 1.2.x | 0.7.x | 0.6.x | |
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.1.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | [![0.7.x][sources-0.7.x-image]][sources-0.7.x] | [![0.6.x][sources-0.6.x-image]][sources-0.6.x] |
Compatibility | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 2.7][python27-image]][python27-docs] |
File truncated at 100 lines see the full file
Release Notes
Forthcoming
- ...
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
- [behaviours, decorators] behaviours.Count -> behaviours.StatusQueue + decorators.Count (new), #376
- [behaviours] StatusSequence -> StatusQueue, #372
- [behaviours, decorators, composites] abstract base classes, #375
- [composites] use explicit composite arguments, #370
The latter is a theme adopted more liberally across (most) of the py_trees library. As this library has grown, it's become apparent that being explicit about passing arguments to constructors is more important than the convenience of eliminating a few characters. Not only does it prevent bugs, it eases refactoring and greatly improves readability of the code. In fact, you'll save time in the long run.
``` python
This:
parallel = py_trees.composite.Parallel(
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.3.0 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | devel |
Last Updated | 2025-06-19 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
- Sebastian Castro
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
PyTrees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators, and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2025-01-11] Support for Python 3.12 was added, and Python 3.8 was dropped.
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.3.x][docs-2.3.x-image]][docs-2.3.x] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x]
Getting Started
You can get started on Codespaces (with no mismatched environment issues and in under 5 minutes) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(docker) zen@py_trees:/workspaces/py_trees$ poetry shell
(py-trees-py3.10) (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.10) (docker) zen@py_trees:/workspaces/py_trees$ py-trees-demo-blackboard
...
(py-trees-py3.10) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py310 py312 format check mypy310 mypy312
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py310
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed.
If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.3.x
- Support for Python 3.12 was added, and Python 3.8 was dropped. -
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.3.x | 2.2.x | 2.1.x | 2.0.x | 1.2.x | ||
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.3.x][sources-2.3.x-image]][sources-2.3.x] | [![2.2.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | |
Compatibility | [![Python 3.12][python312-image]][python312-docs] [![Python 3.10][python310-image]][python310-docs] |
[![Python 3.12][python312-image]][python312-docs] [![Python 3.10][python310-image]][python310-docs] |
[![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] |
[![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] |
File truncated at 100 lines see the full file
Release Notes
2.3.0 (2025-01-11)
- [code] Fix CI and update to latest Ubuntu/Python versions (#454)
- [behaviours] Shorten line in docstring (#450)
- [docs] add ticking tree
- [composites] Reduce circulation when the parallel node policy is SuccessOnOne (#440)
- [docs] fix make target (#430)
- [composites] use typing.Sequence for children argument (#436)
- Improve timing of tick_tock() and allow stopping on terminal state (#444)
- [vscode] update extensions, set spell checking to UK
- [behaviours] add ProbabilisticBehaviour(Behaviour)
- [readme] consolidate development instructions
- [code] remove unused import
- [vscode] recommend extensions, especially devcontainers
- Contributors: Daniel Stonier, Efe Mert Demir, Nino Walker, Sebastian Castro, gitpushoriginmaster, wanfeng
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.3.0 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | devel |
Last Updated | 2025-06-19 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
- Sebastian Castro
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
PyTrees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators, and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2025-01-11] Support for Python 3.12 was added, and Python 3.8 was dropped.
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.3.x][docs-2.3.x-image]][docs-2.3.x] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x]
Getting Started
You can get started on Codespaces (with no mismatched environment issues and in under 5 minutes) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(docker) zen@py_trees:/workspaces/py_trees$ poetry shell
(py-trees-py3.10) (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.10) (docker) zen@py_trees:/workspaces/py_trees$ py-trees-demo-blackboard
...
(py-trees-py3.10) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py310 py312 format check mypy310 mypy312
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py310
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed.
If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.3.x
- Support for Python 3.12 was added, and Python 3.8 was dropped. -
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.3.x | 2.2.x | 2.1.x | 2.0.x | 1.2.x | ||
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.3.x][sources-2.3.x-image]][sources-2.3.x] | [![2.2.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | |
Compatibility | [![Python 3.12][python312-image]][python312-docs] [![Python 3.10][python310-image]][python310-docs] |
[![Python 3.12][python312-image]][python312-docs] [![Python 3.10][python310-image]][python310-docs] |
[![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] |
[![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] |
File truncated at 100 lines see the full file
Release Notes
2.3.0 (2025-01-11)
- [code] Fix CI and update to latest Ubuntu/Python versions (#454)
- [behaviours] Shorten line in docstring (#450)
- [docs] add ticking tree
- [composites] Reduce circulation when the parallel node policy is SuccessOnOne (#440)
- [docs] fix make target (#430)
- [composites] use typing.Sequence for children argument (#436)
- Improve timing of tick_tock() and allow stopping on terminal state (#444)
- [vscode] update extensions, set spell checking to UK
- [behaviours] add ProbabilisticBehaviour(Behaviour)
- [readme] consolidate development instructions
- [code] remove unused import
- [vscode] recommend extensions, especially devcontainers
- Contributors: Daniel Stonier, Efe Mert Demir, Nino Walker, Sebastian Castro, gitpushoriginmaster, wanfeng
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
py_trees_ros | |
py_trees_ros_tutorials |
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.3.0 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | devel |
Last Updated | 2025-06-19 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
- Sebastian Castro
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
PyTrees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators, and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2025-01-11] Support for Python 3.12 was added, and Python 3.8 was dropped.
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.3.x][docs-2.3.x-image]][docs-2.3.x] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x]
Getting Started
You can get started on Codespaces (with no mismatched environment issues and in under 5 minutes) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(docker) zen@py_trees:/workspaces/py_trees$ poetry shell
(py-trees-py3.10) (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.10) (docker) zen@py_trees:/workspaces/py_trees$ py-trees-demo-blackboard
...
(py-trees-py3.10) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py310 py312 format check mypy310 mypy312
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py310
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed.
If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.3.x
- Support for Python 3.12 was added, and Python 3.8 was dropped. -
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.3.x | 2.2.x | 2.1.x | 2.0.x | 1.2.x | ||
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.3.x][sources-2.3.x-image]][sources-2.3.x] | [![2.2.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | |
Compatibility | [![Python 3.12][python312-image]][python312-docs] [![Python 3.10][python310-image]][python310-docs] |
[![Python 3.12][python312-image]][python312-docs] [![Python 3.10][python310-image]][python310-docs] |
[![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] |
[![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] |
File truncated at 100 lines see the full file
Release Notes
2.3.0 (2025-01-11)
- [code] Fix CI and update to latest Ubuntu/Python versions (#454)
- [behaviours] Shorten line in docstring (#450)
- [docs] add ticking tree
- [composites] Reduce circulation when the parallel node policy is SuccessOnOne (#440)
- [docs] fix make target (#430)
- [composites] use typing.Sequence for children argument (#436)
- Improve timing of tick_tock() and allow stopping on terminal state (#444)
- [vscode] update extensions, set spell checking to UK
- [behaviours] add ProbabilisticBehaviour(Behaviour)
- [readme] consolidate development instructions
- [code] remove unused import
- [vscode] recommend extensions, especially devcontainers
- Contributors: Daniel Stonier, Efe Mert Demir, Nino Walker, Sebastian Castro, gitpushoriginmaster, wanfeng
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
py_trees_ros | |
py_trees_ros_tutorials |
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.2.3 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/2.2.x |
Last Updated | 2023-02-08 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases] [Developers]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2023-01-28] The [2.2.x Release][new-2.2.x] is out! Sequences and Selectors with AND without memory.
- [2023-01-28] Get Started with py_trees in under 5mins.
- [2023-01-28] This is now a
poetry
project with configuration governed bypyproject.toml
.- The vestigial
setup.py
is only to assist distribution where PEP-517 is not yet well supported.
- The vestigial
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x] [![0.7.x][docs-0.7.x-image]][docs-0.7.x] [![0.6.x][docs-0.6.x-image]][docs-0.6.x]
Getting Started
You can get started on CodeSpaces (with no mismatched environment issues and in under 5mins) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(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
...
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py38 py310 format check mypy38 mypy310
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py38
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed. If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.2.x | 2.1.x | 2.0.x | 1.2.x | 0.7.x | 0.6.x | |
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.1.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | [![0.7.x][sources-0.7.x-image]][sources-0.7.x] | [![0.6.x][sources-0.6.x-image]][sources-0.6.x] |
Compatibility | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 2.7][python27-image]][python27-docs] |
File truncated at 100 lines see the full file
Release Notes
Forthcoming
- ...
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
- [behaviours, decorators] behaviours.Count -> behaviours.StatusQueue + decorators.Count (new), #376
- [behaviours] StatusSequence -> StatusQueue, #372
- [behaviours, decorators, composites] abstract base classes, #375
- [composites] use explicit composite arguments, #370
The latter is a theme adopted more liberally across (most) of the py_trees library. As this library has grown, it's become apparent that being explicit about passing arguments to constructors is more important than the convenience of eliminating a few characters. Not only does it prevent bugs, it eases refactoring and greatly improves readability of the code. In fact, you'll save time in the long run.
``` python
This:
parallel = py_trees.composite.Parallel(
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.2.3 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/2.2.x |
Last Updated | 2023-02-08 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases] [Developers]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2023-01-28] The [2.2.x Release][new-2.2.x] is out! Sequences and Selectors with AND without memory.
- [2023-01-28] Get Started with py_trees in under 5mins.
- [2023-01-28] This is now a
poetry
project with configuration governed bypyproject.toml
.- The vestigial
setup.py
is only to assist distribution where PEP-517 is not yet well supported.
- The vestigial
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x] [![0.7.x][docs-0.7.x-image]][docs-0.7.x] [![0.6.x][docs-0.6.x-image]][docs-0.6.x]
Getting Started
You can get started on CodeSpaces (with no mismatched environment issues and in under 5mins) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(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
...
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py38 py310 format check mypy38 mypy310
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py38
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed. If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.2.x | 2.1.x | 2.0.x | 1.2.x | 0.7.x | 0.6.x | |
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.1.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | [![0.7.x][sources-0.7.x-image]][sources-0.7.x] | [![0.6.x][sources-0.6.x-image]][sources-0.6.x] |
Compatibility | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 2.7][python27-image]][python27-docs] |
File truncated at 100 lines see the full file
Release Notes
Forthcoming
- ...
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
- [behaviours, decorators] behaviours.Count -> behaviours.StatusQueue + decorators.Count (new), #376
- [behaviours] StatusSequence -> StatusQueue, #372
- [behaviours, decorators, composites] abstract base classes, #375
- [composites] use explicit composite arguments, #370
The latter is a theme adopted more liberally across (most) of the py_trees library. As this library has grown, it's become apparent that being explicit about passing arguments to constructors is more important than the convenience of eliminating a few characters. Not only does it prevent bugs, it eases refactoring and greatly improves readability of the code. In fact, you'll save time in the long run.
``` python
This:
parallel = py_trees.composite.Parallel(
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.2.2 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/1.2.x |
Last Updated | 2019-08-06 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
[About][Status][Demos & Tutorials][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:
- Sequence, Selector, Parallel and Chooser composites
- Blackboards for data sharing
- Python generators for smarter ticking over the tree graph
- Python decorators for enabling meta behaviours
- Render trees to dot graphs or visualise with ascii graphs on stdout
Docs and Demos
Status
Devel | 1.2.x | 0.6.x | 0.5.x | ||
---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | [![0.6.x][sources-0.6.x-image]][sources-0.6.x] | [![0.5.x][sources-0.5.x-image]][sources-0.5.x] | |
Compatibility | |||||
Continuous Integration | |||||
Documentation | ![devel-Docs][rtd-devel-image] | ![1.2.x-Docs][rtd-1.2.x-image] | ![0.6.x-Docs][rtd-0.6.x-image] | ![0.5.x-Docs][not-available-docs-image] |
Installation
From ppa on Ubuntu/Bionic:
$ sudo apt install python3-py-trees
From pypi:
$ pip install py_trees
In a Python Virtual Environment:
$ git clone https://github.com/splintered-reality/py_trees
$ cd py_trees
$ source ./virtualenv.bash
Build your own python3 deb:
$ git clone https://github.com/splintered-reality/py_trees
$ cd py_trees
$ source ./virtualenv.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.
File truncated at 100 lines see the full file
Release Notes
Forthcoming
1.2.2 (2019-08-06)
- [trees] standalone
setup()
method with timer for use on unmanaged trees, #198 - [examples] fix api in
skeleton_tree.py
, #199
1.2.1 (2019-05-21)
- [decorators]
StatusToBlackboard
reflects the status of it's child to the blackboard, #195 - [decorators]
EternalGuard
decorator that continuously guards a subtree (c.f. Unreal conditions), #195 - [idioms]
eternal_guard
counterpart to the decorator whose conditions are behaviours, #195
1.2.x (2019-04-28)
Breaking API
- [trees] removes the curious looking and unused
destroy()
method, #193 - [display]
ascii_tree
->ascii_tree
/unicode_tree()
, no longer subverts the choice depending on your stdout, #192 - [display]
dot_graph
->dot_tree
for consistency with the text tree methods, #192
New Features
- [behaviour]
shutdown()
method to complimentsetup()
, #193 - [decorators]
StatusToBlackboard
reflects the status of it's child to the blackboard, #195 - [decorators]
EternalGuard
decorator that continuously guards a subtree (c.f. Unreal conditions), #195 - [display]
xhtml_tree
provides an xhtml compatible equivalent to theascii_tree
representation, #192 - [idioms]
eternal_guard
counterpart to the decorator whose conditions are behaviours, #195 - [trees] walks the tree calling
shutdown()
on each node in it's ownshutdown()
method, #193 - [visitors] get a
finalise()
method called immediately prior to post tick handlers, #191
1.1.0 (2019-03-19)
Breaking API
- [display] print_ascii_tree -> ascii_tree, #178.
- [display] generate_pydot_graph -> dot_graph, #178.
- [trees] tick_tock(sleep_ms, ..) -> tick_tock(period_ms, ...), #182.
New Features
- [trees] add missing
add_visitor()
method - [trees] flexible
setup()
for children via kwargs - [trees] convenience method for ascii tree debugging
- [display] highlight the tip in ascii tree snapshots
Bugfixes
- [trees] threaded timers for setup (avoids multiprocessing problems)
- [behaviour|composites] bugfix tip behaviour, add tests
- [display] correct first indent when non-zero in ascii_tree
- [display] apply same formatting to root as children in ascii_tree
1.0.7 (2019-xx-yy)
- [display] optional arguments for generate_pydot_graph
1.0.6 (2019-03-06)
- [decorators] fix missing root feedback message in ascii graphs
1.0.5 (2019-02-28)
- [decorators] fix timeout bug that doesn't respect a child's last tick
1.0.4 (2019-02-26)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.0.16 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/2.0.x |
Last Updated | 2020-08-11 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
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:
- Sequence, Selector, Parallel and Chooser composites
- Blackboards for data sharing
- Python generators for smarter ticking over the tree graph
- Python decorators for enabling meta behaviours
- Render trees to dot graphs or visualise with ascii graphs on stdout
Docs and Demos
[![devel][docs-devel-image]][docs-devel] [![2.0.x][docs-2.0.x-image]][docs-2.0.x] [![1.2.x][docs-1.2.x-image]][docs-1.2.x] [![0.6.x][docs-0.6.x-image]][docs-0.6.x]
Releases
-
0.5.x
/0.6.x
- first open source releases -
1.0.x
- first stable release -
1.1.x
- improvements -
1.2.x
- improvements -
2.0.x
- blackboards v2, with namespaces, access permissions and key tracking
Installation
From ppa on Ubuntu/Bionic:
$ sudo apt install python3-py-trees
From pypi:
$ pip install py_trees
In a Python Virtual Environment:
$ git clone https://github.com/splintered-reality/py_trees
$ cd py_trees
$ source ./virtualenv.bash
Build your own python3 deb:
$ git clone https://github.com/splintered-reality/py_trees
$ cd py_trees
$ source ./virtualenv.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.
File truncated at 100 lines see the full file
Release Notes
Forthcoming
- ...
2.0.16 (2020-08-11)
- [behaviours] generators for variable values in SetBlackboardVariable, #300
2.0.15 (2020-05-14)
- [composites] fix current_child problems on dynamic child insertion/removal, #289
2.0.14 (2020-04-26)
- [blackboard] bugfix metadata not created on static set, #286
2.0.13 (2020-03-24)
- [composites] parallel bugfix to invalidate correctly, #285
2.0.12 (2020-03-10)
- [idioms] the either_or pattern, designed to replace the Chooser, #283
- [behaviours] TickCounter, a timer based on tree ticks, #283
- [behaviours] CheckBlackboardVariableValues, logical checks across multiple values, #283
- [common] ComparisonExpression, a more concise way of storing checkers, #283
- [composites] protect against adding a child to multiple parents, #281
2.0.11 (2020-03-01)
- [display] completely remove blackboard variables from the dot layout, #280
2.0.10 (2020-02-27)
- [trees] setup timeout error with last behaviour name included in the error message, #279
- [blackboard] rooted variables in namespaced clients working as designed, fixed docs, #277
2.0.9 (2020-02-14)
- [demos] display modes demonstrating usage of various options, #275
- [display] enforce left to right ordering of children in dot graphs
2.0.8 (2020-02-01)
- [display] bugfix and use elipsis on ascii visited only display modes, #273
2.0.7 (2020-01-24)
- [display] option for only visited behaviours in text tree snapshot displays, #272
2.0.5 (2019-12-25)
- [display] enum agnostic display for local and remote activity view displays
2.0.4 (2019-11-25)
- [display] optional show_title in unicode_blackboard_activity_stream
2.0.3 (2019-11-24)
- [trees] revert to using user signals if available to avoid shenanigans with SIGINT, #264
- [trees] play nicely, reset signal handlers after setup, #262
- [visitors] bugfix the snapshot visitor to look for exclusive write keys as well
2.0.1 (2019-11-19)
- [blackboard] static methods have a namespace too (root), use absolute names,
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
py_trees_ros | |
py_trees_ros_tutorials |
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.2.2 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/1.2.x |
Last Updated | 2019-08-06 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
[About][Status][Demos & Tutorials][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:
- Sequence, Selector, Parallel and Chooser composites
- Blackboards for data sharing
- Python generators for smarter ticking over the tree graph
- Python decorators for enabling meta behaviours
- Render trees to dot graphs or visualise with ascii graphs on stdout
Docs and Demos
Status
Devel | 1.2.x | 0.6.x | 0.5.x | ||
---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | [![0.6.x][sources-0.6.x-image]][sources-0.6.x] | [![0.5.x][sources-0.5.x-image]][sources-0.5.x] | |
Compatibility | |||||
Continuous Integration | |||||
Documentation | ![devel-Docs][rtd-devel-image] | ![1.2.x-Docs][rtd-1.2.x-image] | ![0.6.x-Docs][rtd-0.6.x-image] | ![0.5.x-Docs][not-available-docs-image] |
Installation
From ppa on Ubuntu/Bionic:
$ sudo apt install python3-py-trees
From pypi:
$ pip install py_trees
In a Python Virtual Environment:
$ git clone https://github.com/splintered-reality/py_trees
$ cd py_trees
$ source ./virtualenv.bash
Build your own python3 deb:
$ git clone https://github.com/splintered-reality/py_trees
$ cd py_trees
$ source ./virtualenv.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.
File truncated at 100 lines see the full file
Release Notes
Forthcoming
1.2.2 (2019-08-06)
- [trees] standalone
setup()
method with timer for use on unmanaged trees, #198 - [examples] fix api in
skeleton_tree.py
, #199
1.2.1 (2019-05-21)
- [decorators]
StatusToBlackboard
reflects the status of it's child to the blackboard, #195 - [decorators]
EternalGuard
decorator that continuously guards a subtree (c.f. Unreal conditions), #195 - [idioms]
eternal_guard
counterpart to the decorator whose conditions are behaviours, #195
1.2.x (2019-04-28)
Breaking API
- [trees] removes the curious looking and unused
destroy()
method, #193 - [display]
ascii_tree
->ascii_tree
/unicode_tree()
, no longer subverts the choice depending on your stdout, #192 - [display]
dot_graph
->dot_tree
for consistency with the text tree methods, #192
New Features
- [behaviour]
shutdown()
method to complimentsetup()
, #193 - [decorators]
StatusToBlackboard
reflects the status of it's child to the blackboard, #195 - [decorators]
EternalGuard
decorator that continuously guards a subtree (c.f. Unreal conditions), #195 - [display]
xhtml_tree
provides an xhtml compatible equivalent to theascii_tree
representation, #192 - [idioms]
eternal_guard
counterpart to the decorator whose conditions are behaviours, #195 - [trees] walks the tree calling
shutdown()
on each node in it's ownshutdown()
method, #193 - [visitors] get a
finalise()
method called immediately prior to post tick handlers, #191
1.1.0 (2019-03-19)
Breaking API
- [display] print_ascii_tree -> ascii_tree, #178.
- [display] generate_pydot_graph -> dot_graph, #178.
- [trees] tick_tock(sleep_ms, ..) -> tick_tock(period_ms, ...), #182.
New Features
- [trees] add missing
add_visitor()
method - [trees] flexible
setup()
for children via kwargs - [trees] convenience method for ascii tree debugging
- [display] highlight the tip in ascii tree snapshots
Bugfixes
- [trees] threaded timers for setup (avoids multiprocessing problems)
- [behaviour|composites] bugfix tip behaviour, add tests
- [display] correct first indent when non-zero in ascii_tree
- [display] apply same formatting to root as children in ascii_tree
1.0.7 (2019-xx-yy)
- [display] optional arguments for generate_pydot_graph
1.0.6 (2019-03-06)
- [decorators] fix missing root feedback message in ascii graphs
1.0.5 (2019-02-28)
- [decorators] fix timeout bug that doesn't respect a child's last tick
1.0.4 (2019-02-26)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
py_trees_ros | |
py_trees_ros_tutorials |
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.2.3 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/2.2.x |
Last Updated | 2023-02-08 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases] [Developers]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2023-01-28] The [2.2.x Release][new-2.2.x] is out! Sequences and Selectors with AND without memory.
- [2023-01-28] Get Started with py_trees in under 5mins.
- [2023-01-28] This is now a
poetry
project with configuration governed bypyproject.toml
.- The vestigial
setup.py
is only to assist distribution where PEP-517 is not yet well supported.
- The vestigial
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x] [![0.7.x][docs-0.7.x-image]][docs-0.7.x] [![0.6.x][docs-0.6.x-image]][docs-0.6.x]
Getting Started
You can get started on CodeSpaces (with no mismatched environment issues and in under 5mins) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(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
...
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py38 py310 format check mypy38 mypy310
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py38
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed. If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.2.x | 2.1.x | 2.0.x | 1.2.x | 0.7.x | 0.6.x | |
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.1.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | [![0.7.x][sources-0.7.x-image]][sources-0.7.x] | [![0.6.x][sources-0.6.x-image]][sources-0.6.x] |
Compatibility | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 2.7][python27-image]][python27-docs] |
File truncated at 100 lines see the full file
Release Notes
Forthcoming
- ...
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
- [behaviours, decorators] behaviours.Count -> behaviours.StatusQueue + decorators.Count (new), #376
- [behaviours] StatusSequence -> StatusQueue, #372
- [behaviours, decorators, composites] abstract base classes, #375
- [composites] use explicit composite arguments, #370
The latter is a theme adopted more liberally across (most) of the py_trees library. As this library has grown, it's become apparent that being explicit about passing arguments to constructors is more important than the convenience of eliminating a few characters. Not only does it prevent bugs, it eases refactoring and greatly improves readability of the code. In fact, you'll save time in the long run.
``` python
This:
parallel = py_trees.composite.Parallel(
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.1.6 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/2.1.x |
Last Updated | 2021-05-31 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
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:
- Sequence, Selector, Parallel composites
- Blackboards for data sharing
- Python generators for smarter ticking over the tree graph
- Python decorators for enabling meta behaviours
- Render trees to dot graphs or visualise with ascii graphs on stdout
Docs and Demos
Core API documentation (also includes some explanation concerning the demo scripts):
[![devel][docs-devel-image]][docs-devel] [![2.1.x][docs-2.1.x-image]][docs-2.1.x] [![0.7.x][docs-0.7.x-image]][docs-0.7.x] [![0.6.x][docs-0.6.x-image]][docs-0.6.x]
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
-
0.y.x
- first open source releases -
1.0.x
- first stable release -
1.1.x
- improvements -
1.2.x
- improvements -
2.0.x
- blackboards v2 with namespaces, access permissions and key tracking -
2.1.x
- Chooser deprecated, api housekeeping
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.
File truncated at 100 lines see the full file
Release Notes
Forthcoming
- ...
2.1.6 (2021-05-31)
- [tests] mypy conformance, #327
- [composites] show ghost states for sequence children, #330 (reverts behaviour introduced in #325)
2.1.5 (2021-05-09)
- [composites] sequences w/o memory, #325
- [composites] selectors with memory, #324
- [display] unicode trees are unicode, not ascii #324
2.1.4 (2021-02-24)
- [behaviours] added BlackboardToStatus, #320
- [idioms] bugfix lost append in blackboard names for either_or, #319
- [docs] contributing guidelines added, #315
2.1.3 (2020-12-13)
- [blackboard] convenience [absolute_name()]{.title-ref} api for blackboard clients, #306
2.1.2 (2020-11-05)
- [sequences] bugfix current child setting whilst moving through children, #304
2.1.1 (2020-08-11)
- [behaviours] generators for variable values in SetBlackboardVariable, #300
2.1.0 (2020-07-20)
- [behaviours] CheckBlackboardVariableValue, WaitForBlackboardVariableValue use comparison expressins, #296
- [idioms] eternal_guard uses blackboard_names (previously blackboard_name_prefix), #295
- [composites] Chooser deprecated, #293
- [composites] chain-able add_children for all composites, #290
2.0.16 (2020-08-11)
- [behaviours] generators for variable values in SetBlackboardVariable, #300
2.0.15 (2020-05-14)
- [composites] fix current_child problems on dynamic child insertion/removal, #289
2.0.14 (2020-04-26)
- [blackboard] bugfix metadata not created on static set, #286
2.0.13 (2020-03-24)
- [composites] parallel bugfix to invalidate correctly, #285
2.0.12 (2020-03-10)
- [idioms] the either_or pattern, designed to replace the Chooser, #283
- [behaviours] TickCounter, a timer based on tree ticks, #283
- [behaviours] CheckBlackboardVariableValues, logical checks across multiple values, #283
- [common] ComparisonExpression, a more concise way of storing checkers, #283
- [composites] protect against adding a child to multiple parents, #281
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
py_trees_ros | |
py_trees_ros_tutorials |
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.3.0 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | devel |
Last Updated | 2025-06-19 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
- Sebastian Castro
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
PyTrees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators, and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2025-01-11] Support for Python 3.12 was added, and Python 3.8 was dropped.
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.3.x][docs-2.3.x-image]][docs-2.3.x] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x]
Getting Started
You can get started on Codespaces (with no mismatched environment issues and in under 5 minutes) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(docker) zen@py_trees:/workspaces/py_trees$ poetry shell
(py-trees-py3.10) (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.10) (docker) zen@py_trees:/workspaces/py_trees$ py-trees-demo-blackboard
...
(py-trees-py3.10) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py310 py312 format check mypy310 mypy312
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py310
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed.
If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.3.x
- Support for Python 3.12 was added, and Python 3.8 was dropped. -
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.3.x | 2.2.x | 2.1.x | 2.0.x | 1.2.x | ||
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.3.x][sources-2.3.x-image]][sources-2.3.x] | [![2.2.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | |
Compatibility | [![Python 3.12][python312-image]][python312-docs] [![Python 3.10][python310-image]][python310-docs] |
[![Python 3.12][python312-image]][python312-docs] [![Python 3.10][python310-image]][python310-docs] |
[![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] |
[![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] |
File truncated at 100 lines see the full file
Release Notes
2.3.0 (2025-01-11)
- [code] Fix CI and update to latest Ubuntu/Python versions (#454)
- [behaviours] Shorten line in docstring (#450)
- [docs] add ticking tree
- [composites] Reduce circulation when the parallel node policy is SuccessOnOne (#440)
- [docs] fix make target (#430)
- [composites] use typing.Sequence for children argument (#436)
- Improve timing of tick_tock() and allow stopping on terminal state (#444)
- [vscode] update extensions, set spell checking to UK
- [behaviours] add ProbabilisticBehaviour(Behaviour)
- [readme] consolidate development instructions
- [code] remove unused import
- [vscode] recommend extensions, especially devcontainers
- Contributors: Daniel Stonier, Efe Mert Demir, Nino Walker, Sebastian Castro, gitpushoriginmaster, wanfeng
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
py_trees_ros |
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.2.3 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/2.2.x |
Last Updated | 2023-02-08 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases] [Developers]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2023-01-28] The [2.2.x Release][new-2.2.x] is out! Sequences and Selectors with AND without memory.
- [2023-01-28] Get Started with py_trees in under 5mins.
- [2023-01-28] This is now a
poetry
project with configuration governed bypyproject.toml
.- The vestigial
setup.py
is only to assist distribution where PEP-517 is not yet well supported.
- The vestigial
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x] [![0.7.x][docs-0.7.x-image]][docs-0.7.x] [![0.6.x][docs-0.6.x-image]][docs-0.6.x]
Getting Started
You can get started on CodeSpaces (with no mismatched environment issues and in under 5mins) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(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
...
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py38 py310 format check mypy38 mypy310
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py38
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed. If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.2.x | 2.1.x | 2.0.x | 1.2.x | 0.7.x | 0.6.x | |
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.1.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | [![0.7.x][sources-0.7.x-image]][sources-0.7.x] | [![0.6.x][sources-0.6.x-image]][sources-0.6.x] |
Compatibility | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 2.7][python27-image]][python27-docs] |
File truncated at 100 lines see the full file
Release Notes
Forthcoming
- ...
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
- [behaviours, decorators] behaviours.Count -> behaviours.StatusQueue + decorators.Count (new), #376
- [behaviours] StatusSequence -> StatusQueue, #372
- [behaviours, decorators, composites] abstract base classes, #375
- [composites] use explicit composite arguments, #370
The latter is a theme adopted more liberally across (most) of the py_trees library. As this library has grown, it's become apparent that being explicit about passing arguments to constructors is more important than the convenience of eliminating a few characters. Not only does it prevent bugs, it eases refactoring and greatly improves readability of the code. In fact, you'll save time in the long run.
``` python
This:
parallel = py_trees.composite.Parallel(
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.2.3 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/2.2.x |
Last Updated | 2023-02-08 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases] [Developers]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2023-01-28] The [2.2.x Release][new-2.2.x] is out! Sequences and Selectors with AND without memory.
- [2023-01-28] Get Started with py_trees in under 5mins.
- [2023-01-28] This is now a
poetry
project with configuration governed bypyproject.toml
.- The vestigial
setup.py
is only to assist distribution where PEP-517 is not yet well supported.
- The vestigial
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x] [![0.7.x][docs-0.7.x-image]][docs-0.7.x] [![0.6.x][docs-0.6.x-image]][docs-0.6.x]
Getting Started
You can get started on CodeSpaces (with no mismatched environment issues and in under 5mins) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(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
...
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py38 py310 format check mypy38 mypy310
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py38
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed. If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.2.x | 2.1.x | 2.0.x | 1.2.x | 0.7.x | 0.6.x | |
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.1.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | [![0.7.x][sources-0.7.x-image]][sources-0.7.x] | [![0.6.x][sources-0.6.x-image]][sources-0.6.x] |
Compatibility | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 2.7][python27-image]][python27-docs] |
File truncated at 100 lines see the full file
Release Notes
Forthcoming
- ...
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
- [behaviours, decorators] behaviours.Count -> behaviours.StatusQueue + decorators.Count (new), #376
- [behaviours] StatusSequence -> StatusQueue, #372
- [behaviours, decorators, composites] abstract base classes, #375
- [composites] use explicit composite arguments, #370
The latter is a theme adopted more liberally across (most) of the py_trees library. As this library has grown, it's become apparent that being explicit about passing arguments to constructors is more important than the convenience of eliminating a few characters. Not only does it prevent bugs, it eases refactoring and greatly improves readability of the code. In fact, you'll save time in the long run.
``` python
This:
parallel = py_trees.composite.Parallel(
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.2.3 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/2.2.x |
Last Updated | 2023-02-08 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases] [Developers]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2023-01-28] The [2.2.x Release][new-2.2.x] is out! Sequences and Selectors with AND without memory.
- [2023-01-28] Get Started with py_trees in under 5mins.
- [2023-01-28] This is now a
poetry
project with configuration governed bypyproject.toml
.- The vestigial
setup.py
is only to assist distribution where PEP-517 is not yet well supported.
- The vestigial
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x] [![0.7.x][docs-0.7.x-image]][docs-0.7.x] [![0.6.x][docs-0.6.x-image]][docs-0.6.x]
Getting Started
You can get started on CodeSpaces (with no mismatched environment issues and in under 5mins) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(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
...
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py38 py310 format check mypy38 mypy310
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py38
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed. If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.2.x | 2.1.x | 2.0.x | 1.2.x | 0.7.x | 0.6.x | |
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.1.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | [![0.7.x][sources-0.7.x-image]][sources-0.7.x] | [![0.6.x][sources-0.6.x-image]][sources-0.6.x] |
Compatibility | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 2.7][python27-image]][python27-docs] |
File truncated at 100 lines see the full file
Release Notes
Forthcoming
- ...
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
- [behaviours, decorators] behaviours.Count -> behaviours.StatusQueue + decorators.Count (new), #376
- [behaviours] StatusSequence -> StatusQueue, #372
- [behaviours, decorators, composites] abstract base classes, #375
- [composites] use explicit composite arguments, #370
The latter is a theme adopted more liberally across (most) of the py_trees library. As this library has grown, it's become apparent that being explicit about passing arguments to constructors is more important than the convenience of eliminating a few characters. Not only does it prevent bugs, it eases refactoring and greatly improves readability of the code. In fact, you'll save time in the long run.
``` python
This:
parallel = py_trees.composite.Parallel(
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 2.2.3 |
License | BSD |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/2.2.x |
Last Updated | 2023-02-08 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
[About] [What’s New?] [Documentation] [Getting Started] [Next Steps] [Releases] [Developers]
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:
- Behaviours, Decorators, Sequences, Selectors, Parallels and BehaviourTree.
- Blackboards for data sharing.
- A useful library of behaviours, decorators and idioms.
- Serialise to a dot graph or render to ascii/unicode in a terminal.
- Tested on Linux and Mac (YMMV with Windows).
What’s New?
- [2023-01-28] The [2.2.x Release][new-2.2.x] is out! Sequences and Selectors with AND without memory.
- [2023-01-28] Get Started with py_trees in under 5mins.
- [2023-01-28] This is now a
poetry
project with configuration governed bypyproject.toml
.- The vestigial
setup.py
is only to assist distribution where PEP-517 is not yet well supported.
- The vestigial
Documentation
[![devel][docs-devel-image]][docs-devel] [![2.2.x][docs-2.2.x-image]][docs-2.2.x] [![2.1.x][docs-2.1.x-image]][docs-2.1.x] [![0.7.x][docs-0.7.x-image]][docs-0.7.x] [![0.6.x][docs-0.6.x-image]][docs-0.6.x]
Getting Started
You can get started on CodeSpaces (with no mismatched environment issues and in under 5mins) [1]:
- Fork the project to your personal account
- Click on Code -> Codespaces -> + Create a Codespace
- Enter the Terminal
# Install Dependencies
(docker) zen@py_trees:/workspaces/py_trees$ poetry install
# Explore the demos
(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
...
(py-trees-py3.8) (docker) zen@py_trees:/workspaces/py_trees$ exit
# Hack some Code
# Run the Formatter, Tests, Linters and Mypy
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -l
py38 py310 format check mypy38 mypy310
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e format
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e py38
...
(docker) zen@py_trees:/workspaces/py_trees$ poetry run tox -e check
...
# Contribute a PR!
# https://github.com/splintered-reality/py_trees/blob/devel/CONTRIBUTING.md
[1] All of the above will, of course, work in a local environment if you have poetry
installed. If you’re using VSCode
you don’t even need that, just reopen the project in the devcontainer and be froody.
Next Steps
On PyPi:
Examples:
- ReadTheDocs - PyTrees ROS Tutorials - significantly more edifying than the demos, these incrementally walk through the process of building a decision making layer for a robot. These use ROS2 (sparsely), but merely browsing should be enlightening regardless.
Visualisation:
- py_trees_js - a javascript library for building your own runtime visualisation tool
Robotics:
-
py_trees_ros - a tree manager and behaviours designed for use specifically with
ROS2
-
py_trees_ros_viewer - a
Qt/ROS2
implementation ofpy_trees_js
Releases
-
2.2.x
- Selectors, Sequences with and without memory. Improved testing and style/type checking. -
2.1.x
- Chooser deprecated. API housekeeping. -
2.0.x
- Blackboards V2! -
1.2.x
- Trees can now shutdown cleanly. StatusToBlackboard and EternalGuard, Visitors get finalise(). -
1.1.x
- Fixes for setup, tick-tock, viz. -
1.0.x
- Behaviours, Decorators, Composites, Blackboards, Tree Management and Viz tools. -
0.y.x
- First open source pre-releases.
Devel | 2.2.x | 2.1.x | 2.0.x | 1.2.x | 0.7.x | 0.6.x | |
---|---|---|---|---|---|---|---|
Sources | [![devel][sources-devel-image]][sources-devel] | [![2.1.x][sources-2.2.x-image]][sources-2.2.x] | [![2.1.x][sources-2.1.x-image]][sources-2.1.x] | [![2.0.x][sources-2.0.x-image]][sources-2.0.x] | [![1.2.x][sources-1.2.x-image]][sources-1.2.x] | [![0.7.x][sources-0.7.x-image]][sources-0.7.x] | [![0.6.x][sources-0.6.x-image]][sources-0.6.x] |
Compatibility | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.10][python310-image]][python310-docs] [![Python 3.8][python38-image]][python38-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 3.6][python36-image]][python36-docs] | [![Python 2.7][python27-image]][python27-docs] |
File truncated at 100 lines see the full file
Release Notes
Forthcoming
- ...
2.2.3 (2023-02-08)
- [decorators] a passthrough for debugging and visualisation, #407
2.2.2 (2023-01-28)
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
2.2.1 (2023-01-28)
2.2.x (2023-01-23) - Sequences and Selectors with and without Memory!
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
- [behaviours, decorators] behaviours.Count -> behaviours.StatusQueue + decorators.Count (new), #376
- [behaviours] StatusSequence -> StatusQueue, #372
- [behaviours, decorators, composites] abstract base classes, #375
- [composites] use explicit composite arguments, #370
The latter is a theme adopted more liberally across (most) of the py_trees library. As this library has grown, it's become apparent that being explicit about passing arguments to constructors is more important than the convenience of eliminating a few characters. Not only does it prevent bugs, it eases refactoring and greatly improves readability of the code. In fact, you'll save time in the long run.
``` python
This:
parallel = py_trees.composite.Parallel(
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.5.12 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/0.5.x |
Last Updated | 2019-03-22 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
- Naveed Usmani
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
This 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:
- Sequence, Selector, Parallel and Chooser composites
- Blackboards for data sharing
- Python generators for smarter ticking over the tree graph
- Python decorators for enabling meta behaviours
- Render trees to dot graphs or visualise with ascii graphs on stdout
Detailed api reference and demo instructions can be found in the sphinx documentation for the package. There is also the py_trees_ros package which includes additional modules and documentation for using py_trees with ROS.
Sources, Builds & Docs
Devel | Kinetic | Indigo |
---|---|---|
Getting Started
Installation
From ppa on Ubuntu/Xenial
sudo apt install python-py-trees
From pypi:
pip install py_trees
Or in a sandboxed ROS Kinetic environment (coming soon):
sudo apt install ros-kinetic-py-trees
Development
You can develop in either a virtualenv (python style):
source ./virtualenv.bash
or in a catkin environment alongside other ROS py-trees packages:
- https://github.com/stonier/repos_index/blob/devel/kinetic/py_trees.repos
Changelog
Forthcoming
- [docs] fix some warnings
0.5.12 (2019-02-13)
- [decorators] default option for collapsing decorators (resolves py_trees_ros bug)
0.5.11 (2019-02-13)
[decorators] new-style decorators can be found in py_trees.decorators [decorators] new-style decorators now stop their running child on completion (SUCCESS||FAILURE) [meta] behaviours from functions can now automagically generate names
0.5.10 (2017-06-17)
- [meta] add children monkeypatching for composite imposters
- [blackboard] check for nested variables in WaitForBlackboard
0.5.9 (2017-03-25)
- [docs] bugfix image links and rewrite the motivation
0.5.8 (2017-03-19)
- [infra] setup.py tests_require, not test_require
0.5.7 (2017-03-01)
- [infra] update maintainer email
0.5.5 (2017-03-01)
- [docs] many minor doc updates
- [meta] bugfix so that imposter now ticks over composite children
- [trees] method for getting the tip of the tree
- [programs] py-trees-render program added
0.5.4 (2017-02-22)
- [infra] handle pypi/catkin conflicts with install_requires
0.5.2 (2017-02-22)
- [docs] disable colour when building
- [docs] sidebar headings
- [docs] dont require project installation
0.5.1 (2017-02-21)
- [infra] pypi package enabled
0.5.0 (2017-02-21)
- [ros] components moved to py_trees_ros
- [timeout] bugfix to ensure timeout decorator initialises properly
- [docs] rolled over with napolean style
- [docs] sphinx documentation updated
- [imposter] make sure tip() drills down into composites
- [demos] re-organised into modules
0.4.0 (2017-01-13)
- [trees] add pre/post handlers after setup, just in case setup fails
- [introspection] do parent lookups so you can crawl back up a tree
- [blackboard] permit init of subscriber2blackboard behaviours
- [blackboard] watchers
- [timers] better feedback messages
- [imposter] ensure stop() directly calls the composited behaviour
0.3.0 (2016-08-25)
-
failure_is_running decorator
(meta).
0.2.0 (2016-06-01)
- do terminate properly amongst relevant classes
- blackboxes
- chooser variant of selectors
- bugfix the decorators
- blackboard updates on change only
- improved dot graph creation
- many bugfixes to composites
- subscriber behaviours
- timer behaviours
0.1.2 (2015-11-16)
- one shot sequences
- abort() renamed more appropriately to stop()
0.1.1 (2015-10-10)
- lots of bugfixing stabilising py_trees for the spain field test
- complement decorator for behaviours
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Name | Deps |
---|---|
py_trees_ros | |
rqt_py_trees |
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.6.9 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/0.6.x |
Last Updated | 2021-01-10 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
- Naveed Usmani
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
This 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:
- Sequence, Selector, Parallel and Chooser composites
- Blackboards for data sharing
- Python generators for smarter ticking over the tree graph
- Python decorators for enabling meta behaviours
- Render trees to dot graphs or visualise with ascii graphs on stdout
Detailed api reference and demo instructions can be found in the sphinx documentation for the package. There is also the py_trees_ros package which includes additional modules and documentation for using py_trees with ROS.
Sources, Builds & Docs
Devel | Melodic | Kinetic | |
---|---|---|---|
Getting Started
Installation
From ppa on Ubuntu/Xenial
sudo apt install python-py-trees
From pypi:
pip install py_trees
Or in a sandboxed ROS Kinetic environment (coming soon):
sudo apt install ros-kinetic-py-trees
Development
You can develop in either a virtualenv (python style):
# python 2
source ./virtualenv.bash
# python 3
source ./virtualenv3.bash
or in a catkin environment alongside other ROS py-trees packages:
- https://github.com/stonier/repos_index/blob/devel/kinetic/py_trees.repos
Changelog
Forthcoming
0.6.9 (2021-01-10)
- [docs] fix some warnings
- [decorators] setting the child's parent as the decorator
0.6.7 (2019-02-13)
- [decorators] default option for collapsing decorators (resolves py_trees_ros bug)
0.6.6 (2019-02-13)
[decorators] new-style decorators can be found in py_trees.decorators [decorators] new-style decorators now stop their running child on completion (SUCCESS||FAILURE) [meta] behaviours from functions can now automagically generate names
0.6.5 (2018-09-19)
- Inverters bugfix - pick up missing feedback messages
- Eliminate costly blackboard variable check feedback message
0.6.4 (2018-09-19)
- Ascii tree bugfix - replace awkward newlines with spaces
0.6.3 (2018-09-04)
- Parallels bugfix - don't send own status to running children, invalidate them instead
0.6.2 (2018-08-31)
- Oneshot bugfix - react to priority interrupts correctly
0.6.1 (2018-08-20)
- Oneshot bugfix - no longer permanently modifies the original class
0.6.0 (2018-05-15)
- Python 2/3 compatibility
0.5.10 (2017-06-17)
- [meta] add children monkeypatching for composite imposters
- [blackboard] check for nested variables in WaitForBlackboard
0.5.9 (2017-03-25)
- [docs] bugfix image links and rewrite the motivation
0.5.8 (2017-03-19)
- [infra] setup.py tests_require, not test_require
0.5.7 (2017-03-01)
- [infra] update maintainer email
0.5.5 (2017-03-01)
- [docs] many minor doc updates
- [meta] bugfix so that imposter now ticks over composite children
- [trees] method for getting the tip of the tree
- [programs] py-trees-render program added
0.5.4 (2017-02-22)
- [infra] handle pypi/catkin conflicts with install_requires
0.5.2 (2017-02-22)
- [docs] disable colour when building
- [docs] sidebar headings
- [docs] dont require project installation
0.5.1 (2017-02-21)
- [infra] pypi package enabled
0.5.0 (2017-02-21)
- [ros] components moved to py_trees_ros
- [timeout] bugfix to ensure timeout decorator initialises properly
- [docs] rolled over with napolean style
- [docs] sphinx documentation updated
- [imposter] make sure tip() drills down into composites
- [demos] re-organised into modules
0.4.0 (2017-01-13)
- [trees] add pre/post handlers after setup, just in case setup fails
- [introspection] do parent lookups so you can crawl back up a tree
- [blackboard] permit init of subscriber2blackboard behaviours
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Name | Deps |
---|---|
py_trees_ros | |
rqt_py_trees |
Launch files
Messages
Services
Plugins
Recent questions tagged py_trees at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.7.6 |
License | BSD |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/splintered-reality/py_trees.git |
VCS Type | git |
VCS Version | release/0.7.x |
Last Updated | 2021-01-10 |
Dev Status | MAINTAINED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Daniel Stonier
- Naveed Usmani
Authors
- Daniel Stonier
- Michal Staniaszek
- Naveed Usmani
Py Trees
This 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:
- Sequence, Selector, Parallel and Chooser composites
- Blackboards for data sharing
- Python generators for smarter ticking over the tree graph
- Python decorators for enabling meta behaviours
- Render trees to dot graphs or visualise with ascii graphs on stdout
Detailed api reference and demo instructions can be found in the sphinx documentation for the package. There is also the py_trees_ros package which includes additional modules and documentation for using py_trees with ROS.
Sources, Builds & Docs
Devel | Melodic | Kinetic | |
---|---|---|---|
Getting Started
Installation
From ppa on Ubuntu/Xenial
sudo apt install python-py-trees
From pypi:
pip install py_trees
Or in a sandboxed ROS Kinetic environment (coming soon):
sudo apt install ros-kinetic-py-trees
Development
You can develop in either a virtualenv (python style):
source ./venv.bash
or in a catkin environment alongside other ROS py-trees packages:
- https://github.com/stonier/repos_index/blob/devel/kinetic/py_trees.repos
Changelog
Forthcoming
- ...
0.7.6 (2021-01-10)
- [infra] skipping archived 0.7.4 and 0.7.5 versions that were dropped in favour of a push to 1.0.x
0.7.4 (2021-01-10)
- [decorators] setting the child's parent as the decorator
0.7.3 (202019-08-02)
- [infra] fix cmake version, zip_safe build warnings for catkin
0.7.2 (202019-08-02)
- [docs] fix some warnings
0.7.1 (202019-07-28)
- [infra] scripts using python3
0.7.0 (202019-07-28)
- [infra] python3 ROS environment support (if using virtualenvs, was already python3 compatible)
0.6.7 (2019-02-13)
- [decorators] default option for collapsing decorators (resolves py_trees_ros bug)
0.6.6 (2019-02-13)
[decorators] new-style decorators can be found in py_trees.decorators [decorators] new-style decorators now stop their running child on completion (SUCCESS||FAILURE) [meta] behaviours from functions can now automagically generate names
0.6.5 (2018-09-19)
- Inverters bugfix - pick up missing feedback messages
- Eliminate costly blackboard variable check feedback message
0.6.4 (2018-09-19)
- Ascii tree bugfix - replace awkward newlines with spaces
0.6.3 (2018-09-04)
- Parallels bugfix - don't send own status to running children, invalidate them instead
0.6.2 (2018-08-31)
- Oneshot bugfix - react to priority interrupts correctly
0.6.1 (2018-08-20)
- Oneshot bugfix - no longer permanently modifies the original class
0.6.0 (2018-05-15)
- Python 2/3 compatibility
0.5.10 (2017-06-17)
- [meta] add children monkeypatching for composite imposters
- [blackboard] check for nested variables in WaitForBlackboard
0.5.9 (2017-03-25)
- [docs] bugfix image links and rewrite the motivation
0.5.8 (2017-03-19)
- [infra] setup.py tests_require, not test_require
0.5.7 (2017-03-01)
- [infra] update maintainer email
0.5.5 (2017-03-01)
- [docs] many minor doc updates
- [meta] bugfix so that imposter now ticks over composite children
- [trees] method for getting the tip of the tree
- [programs] py-trees-render program added
0.5.4 (2017-02-22)
- [infra] handle pypi/catkin conflicts with install_requires
0.5.2 (2017-02-22)
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Name | Deps |
---|---|
py_trees_ros | |
rqt_py_trees |