Behavior Trees in Robotics and AI

Welcome to the webpage of the book Behavior Trees in Robotics and AI

Home

Tutorials

  Pac-Man Example

  Youbot Example

About the Authors

Tutorial for Youbot Example

Here you will find the instructions to run the Youbot example of Chapter 2. You will be able to design the AI of the robot designing your own Behavior Tree (BT) via a Graphical User Interface (GUI).

scenario_youbot

Below you can find the instructions according to your operating system.

Installation in Windows


1) Install Dependencies:

2) Download the repository:

git clone https://github.com/btirai/youbot.git

3) Build the Software:

Run CMake, set the project (youbot) root folder and the desired build folder (your choice). Configure and generate project solution for your favorite IDE (e.g. Visual Studio 13). Then open the solution from your IDE and build the project.

Run in Windows


Installation in Unix


1) Install Dependencies:

2) Download the repository:

git clone https://github.com/btirai/youbot.git

3) Build the Software:

Run in a terminal the following commands:

cd youbot
mkdir build
cd build
cmake ..
make

Run in Unix


sh vrep.sh

./youbot_behavior_tree_editor

Verify your installation


vrepyoubot

editorbtexample

Create your own Behavior Tree


Right Click in the editor to add a node.

Leaf nodes have a text field to fill. You can fill in either an object’s name or a location name. The nodes have the following meanings:

Name Type Description
IsRobotCloseTo (Object) Condition Returns Success if the robot is close to the object defined in the text field is close to the robot (closer than 0.2 m).
IsObjectGrasped (Object) Condition Returns Success if the object defined in the text field is grasped.
IsObjectAt (Object, Location) Condition Returns Success if the object is at location (e.g. IsObjectAt (greenCube, goalLocation)).
IsPathToObjectCollisionFree (Object) Condition Returns Success if the robot is close to the object defined in the text field.
MoveCloseTo (Object/location) Action Moves the robot close to the object/location defined in the text field.
GraspObject (Object) Action Grasps the object defined in the text field.
PutInFront(Object) Action Drops the currently grasped object.
PutAside(Object) Action Place on the side the currently grasped object.

Example of available objects are:

Example of available locations are:

You can add new objects in the scene in VREP, make sure you put in the text field in the BT the name as it appears in the VREP’s Scene Hierarchy (on the left)

NOTE: A BT must have the root node. It cannot have loose nodes (non-connected nodes).