Skip to content

interaction-lab/RE-BT-Espresso

Repository files navigation

RE:BT-Espresso, Representation Exploitation of BT-Espresso for Behavior Trees Learned from Robot Demonstrations

This repo is a pipeline for learning behavior trees from demonstration. It resulted in the following paper:

@inproceedings{wathieu2022re,
  title={RE: BT-Espresso: Improving Interpretability and Expressivity of Behavior Trees Learned from Robot Demonstrations},
  author={Wathieu, Adam and Groechel, Thomas R and Lee, Haemin Jenny and Kuo, Chloe and Matari{\'c}, Maja J},
  booktitle={2022 International Conference on Robotics and Automation (ICRA)},
  pages={11518--11524},
  year={2022},
  organization={IEEE}
}

If you are looking for the algorithm described from the paper, you will want to look at BehaviorTreeDev/BehaviorTreeBuilder.py starting with function re_bt_espresso. I would also encourage you to check out the work that cites this paper, there are some great learning behavior tree algorithms being researched.

Feel free to contact trgroechel@gmail.com if you have any questions. Note that I do not currently have bandwidth to support this project directly. If someone else would like to own it, feel free! I am happy to answer any questions.

Repo Outline

BehaviorTreeBuilder is split up as the following:

  • BTBuildGlobals.py -> contains all global variables (mostly dictionary lookups) w/ descriptions
  • BTBuilderData.py -> contains functions that build global data (typically dictionaries)
  • BTBuilderHelpers.py -> contains helper functions (e.g., save_tree)
  • BTBuilderLAT.py -> contains functions for the Last Action Taken Sequence/Cycles algorithm (algorithm 2 within the paper)
  • BehaviorTreeBuilder.py -> contains the RE-BT:Espresso algorithm code using all of the above (algorithm 1 within the paper)

Install

  1. Clone repo
  2. Install python3 dependencies below (you can create a python3 virtual environment and activate it if you would like first)
  3. Fix pyeda library error

Running Experiments

In the top level directory, to run all experiments: python3 run_experiments.py [-r, --recolor] [-c --config] [-m --multiprocess] where -r is an optional flag to also re-color the trees, -c allows a specification of a single experiment, -m flag runs all experiments in parallel, and '-k' runs the original bt_espresso algo alongside re_bt_espresso. By default, all experiments are run.

Autogenerated usage:

usage: run_experiments.py [-h] [-c CONFIG] [-r] [-m] [-k]

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        Name of experiment config json, without this flag it will recurse though all experiments. `expr0.json` as an example.
  -r, --recolor         Run recoloring of all trees
  -m, --multiprocess    Run experiments in ||
  -k, --kevin           Run w original BT-Espresso also

Experiment Pipeline

  1. DataSim
  2. BuildBT
    • Normalize
    • Hotencode
    • [OPTIONAL] SVMSMOTE Upsampling
    • Learn and Build BT
  3. [OPTIONAL] ReColorBT
  4. RunResults

Dependencies

Easy copy paste:

pip3 install pandas sklearn graphviz imblearn matplotlib lxml py_trees pyeda networkx
sudo apt-get install graphviz

Results analysis expr_analysis.ipynb also depends on the following:

Easy copy paste:

pip3 install matplotlib seaborn

Pyeda Literal Error

There is a bug is Pyeda library that also need to be fixed. See #17 for fix.

Random Note

The title of the paper stems from a response (hence RE:) to BT-Espresso - a paper from the University of Michigan Labratory for Progress led by Prof. Chad Jenkins. This was the lab I was a part of in undergrad :)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published