[ros-users] [Discourse.ros.org] [General] New Software Release - Py Trees

Daniel Stonier ros.discourse at gmail.com
Sat Jun 24 08:21:15 UTC 2017



**About**

[py_trees](https://github.com/stonier/py_trees) and [py_trees_ros](https://github.com/stonier/py_trees_ros) were developed and used on robots at field tests around the world over the course of the last couple of years for Yujin Robot. I'm happy to announce that they're now document complete with a great list of tutorials and ready to be consumed! A brief list of features:

* All the bells and whistles' you'd expect from a comprehensive behaviour tree library
* Assemble trees in relatively simple and short python scripts
* Additional ROS behaviours for common ROS operations (subscriber, move_base, ...)
* A ROS behaviour tree manager with status publisher for connection to an rqt monitoring plugin
* Automatic bagging of the tree status when it changes
* Replay bags in the rqt monitoring program to identify problems
* Simple to mock with a robot layer for debugging, testing on CI and as a rapid simulation for use with web application development.

As you can probably infer, there was a focus on making sure we could easily debug problems, especially when they occurred at a remote test site without an engineer (the replay tool especially was very useful). On the other hand, a graphical designer frontend was not prioritised and never eventuated - scripting a python tree remained simple and flexible enough to suit our needs. We also had the trees pass a litmus test of being able to pass the work of building robot-specific behaviours and trees off to interns. It took three iterations of the core libraries to pass that point, but since then there has been negligible change in the core libraries.

Additionally, the trees started being used beyond the scenarios they were originally designed for. The control engineers started shifting all non-reactive control logic to the trees - it was just easier to follow patterns already implemented and to make use of the bagging/visualisation/replay tools, e.g. implementing an entire subtree for initialisation from a composition of context switches (small dyn. reconfigure changes), enabling/disabling of sensors and simple motions instead of having a separate c++ or python node that would handle the entire process as a custom state machine inside an action. Also, as the logic accumulated in the trees, the data to support it also centralised there, and it eventually became the natural portal point between robot and server/web applications. 

**Availability**

All the py_trees packages (py_trees, py_trees_ros, py_trees_msgs, rqt_py_trees) are on the ros build farm and repository details on the ros wiki. You can also use the py_trees package itself directly from pip as a pure python module.

**Getting Started**

Get started at the [py_trees_ros README](https://github.com/stonier/py_trees_ros). If you just want a quick glimpse of how they can be use in ROS, jump directly to the [py_trees_ros tutorials](http://docs.ros.org/kinetic/api/py_trees_ros/html/tutorials.html).





---
[Visit Topic](https://discourse.ros.org/t/new-software-release-py-trees/2046/1) or reply to this email to respond.




More information about the ros-users mailing list