3. How to compile BT Framework - fkie/fkie_behavior_trees GitHub Wiki

The Behavior Tree Framework is composed by different ROS packages:

  • fkie_behavior_tree_manager creates interfaces to the behavior tree engine provided by BehaviorTree.CPP. It allows us to create nodes that handle the execution of BTs.

Integrations with Move Base Flex for robot navigation, and MoveIt for arm motion execution and planning are also available on the packages:

  • fkie_bt_move_base_actions
  • fkie_bt_moveit_actions

Visualization of the Behavior Tree execution in RVIZ is available on:

  • fkie_bt_visualization

How to compile FKIE BT

  • Install dependencies: Depending on your needs, some of this dependencies might not be required. For instance the MoveIt-packages.
sudo apt install ros-melodic-behaviortree-cpp-v3 ros-melodic-geometric-shapes ros-melodic-geometry-msgs ros-melodic-mbf-msgs ros-melodic-message-generation ros-melodic-message-runtime ros-melodic-moveit-core ros-melodic-moveit-ros-perception ros-melodic-moveit-ros-planning ros-melodic-moveit-ros-planning-interface ros-melodic-moveit-visual-tools ros-melodic-nav-msgs ros-melodic-tf2-eigen ros-melodic-tf2-geometry-msgs ros-melodic-tf2-ros ros-melodic-topic-tools
  • Clone the packages:
cd ros/src
git clone https://github.com/fkie/fkie_behavior_trees

The easiest way of compiling BT Framework is by using catkin tools. If you want to compile ALL Behavior Tree packages (including MoveIt and MBF integration), you can use the meta-package fkie_behavior_trees:

cd fkie_behavior_trees/fkie_behavior_trees
catkin build fkie_behavior_trees 

If you want to compile ONLY the Behavior Tree Manager package:

catkin build fkie_behavior_tree_manager
  • Compile ALL packages for the BT Framework (including MoveIt and MBF integration):
cd ~/ros/src/cms-npc/fkie_behavior_trees/fkie_behavior_trees
catkin build --this
  • Compile ONLY Behavior Tree manager:
cd ~/ros/src/cms-npc/fkie_behavior_trees/fkie_behavior_tree_manager
catkin build --this

How to compile the graphical interface Groot?

Groot offers a nice interface for creating and monitoring the execution of BTs. Some examples/tutorials in this wiki assumes that Groot is installed on ~/ros/external/Groot/build/Groot.

If you want to use it, you can clone and compile it as follows:

  • Install dependencies:
sudo apt install qtbase5-dev libqt5svg5-dev libzmq3-dev libdw-dev
  • Compile project:
mkdir ros/external; cd ros/external
git clone https://github.com/BehaviorTree/Groot.git
cd Groot
git submodule update --init --recursive
mkdir build; cd build
cmake ..
make

(This instruction build upon the instructions from https://github.com/BehaviorTree/Groot. If they change, these here have to be changed as well.)

Now, you can run ./Groot and try it yourself.

Hint: If you want to monitor the execution of a running tree, we have to click first in Monitor and Start, then, we must define the Server IP (default is localhost:1666), and finally click on Connect.