Skip to content

Playing with behavior trees using the BehaviorTree.CPP library.

Notifications You must be signed in to change notification settings

tonik173/behaviortree-example

Repository files navigation

BehaviorTree.CPP examples

The examples in this repository run a simple wire cut and strip machine, using the BehaviorTree.CPP library.

cut and strip illustration

Using docker

The easiest way to play with the example is to run it with Docker. The docker file creates the latest Ubuntu image, installs a few development tools and clones and compiles BehaviorTree.CPP.

  1. Modify the .env file to match your environment. HOST_ROOT_PATH refers to the location of the clone of this repository.
  2. Run docker
docker compose build
docker compose up -d
docker exec -itd btcpp-env terminator
# without an X-Window server just run
docker exec -it btcpp-env bash

If this works, the Terminator (or the bash) terminal app launches.

Compile examples (within docker)

# change directory to demo, where demo is the name of the example
cd behavior-tree-cpp/<demo>  
mkdir build
# On WSL, I had to run the cmake command the first time with <sudo> and then again without <sudo>. 
# Someone knows how to fix this?
cmake -S ./src -B ./build    
cd build
make
# execute demo, where demo is the name of the example
./<demo> [path_to_tree.xml]  

Playing with the BehaviorTree.CPP examples

cd ~/build/examples
./<example>

Using Groot2

The docker image contains already the downloaded installer file in the home directory. Launch the installer and follow the instructions.

Note: Using WSL2, I wasn't able to connect Groot2 with the tree execution app.

Simple Machine

cut and strip with Groot2

Reactive Machine

reactive machine with Groot2

More infos

About

Playing with behavior trees using the BehaviorTree.CPP library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published