The implementations included in this repository are based on the RoboMAX artifact, a extensible collection of robotic mission adaptation exemplars.
Please check the BT.CPP v3 Docs for additional references.
-
Install the ROS2 Humble and nav2 packages
-
Install Groot (BT editing tool)
sudo apt install -y git qtbase5-dev libqt5svg5-dev libzmq3-dev libdw-dev cmake build-essential python3-catkin-pkg-modules
git clone https://github.com/BehaviorTree/Groot.git
cd Groot && git submodule update --init --recursive && mkdir build && cd build && cmake .. && make- Build the rome_bt and rome_sim ROS2 packages.
First, make sure you are using Python 3.10:
python3 --version
# Expect: Python 3.10.xIf not 3.10, install and create a venv with Python 3.10 (recommended):
sudo apt update
sudo apt install -y python3.10 python3.10-venv
python3.10 -m venv ~/.venv/ros_py310
source ~/.venv/ros_py310/bin/activate
pip install -U pip setuptools colcon-common-extensionsIf your system python3 is already 3.10 you can skip the venv step. Then build:
source /opt/ros/humble/setup.bash
colcon build- Source the package installs.
source install/setup.bashThe trees at src/rome_bt/behavior_trees can be executed with the following command:
ros2 launch rome_bt execute_bt.launch.py bt:="full/path/to/tree"The provided rome_bt package is used to develop and run behavior trees. Usually to develop nodes
we create a header file with all our definitions in /include and the actual code implementation in the /src directory.
To execute a node we need to register it to the BT.CPP dynamic loader to load it during runtime.
Try to execute the rome_sim package and then run rome_bt with one of the behavior trees in another terminal.
ros2 launch rome_sim tb4_sim_bringup.launch.pyros2 launch rome_bt execute_bt.launch.py bt:="$(ros2 pkg prefix rome_bt)/share/rome_bt/behavior_trees/[BT].xml"