See also

The Tutorials where most of the following is demonstrated.


py_trees_ros.actions.ActionClient([name, …]) A generic action client interface.
py_trees_ros.battery.ToBlackboard(name[, …]) Subscribes to the battery message and writes battery data to the blackboard.
py_trees_ros.subscribers.CheckData([name, …]) Check a subscriber to see if it has received data.
py_trees_ros.subscribers.EventToBlackboard([…]) Listen for events (std_msgs.msg.Empty) on a subscriber and writes the result to the blackboard.
py_trees_ros.subscribers.ToBlackboard([…]) Saves the latest message to the blackboard and immediately returns success.
py_trees_ros.subscribers.WaitForData([name, …]) Waits for a subscriber’s callback to be triggered.


The Blackboard Exchange wraps a Blackboard with a ROS API to provide easy introspection of a blackboard from outside the tree. This includes both lazily publishing of the entire board when there’s a change as well as services to open windows onto parts of the blackboard for when the entirity becomes too noisy to track.

You get this for free in the ROS Behaviour Tree manager and the py-trees-blackboard-watcher command line utility provides a convenient means of interacting with the watching services.


The ROS Behaviour Tree extends the core Behaviour Tree class with a few ROS style adornments. The major features currently include:

  • Publishers for ascii/dot tree visualisations and the blackboard
  • A publisher which dumps the entire tree at every change for the rqt plugin
  • Bagging of the tree for offline visualisation and debugging


You can visualise the trees in ROS via either the ascii tree publishers (which lack formatting),

rostopic echo /tree/ascii/tree
rostopic echo /tree/ascii/snapshot

the tree-watcher frontend (which adds ascii formatting):

py-trees-tree-watcher --tree
py-trees-tree-watcher --snapshot
py-trees-tree-watcher --namespace my_tree --snapshot

or the rqt_py_trees plugin which tunes in to the ~log/tree topic.