Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
humble

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
jazzy

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
kilted

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
lyrical

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
rolling

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

No version for distro ardent showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
humble

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

No version for distro bouncy showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
humble

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
crystal

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

No version for distro eloquent showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
humble

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

No version for distro dashing showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
humble

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
galactic

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

No version for distro foxy showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
humble

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
iron

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
lunar

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

No version for distro jade showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
humble

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
indigo

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

No version for distro hydro showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
humble

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
kinetic

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
humble

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange

Package symbol

behaviortree_cpp package from behaviortree_cpp_v3 repo

behaviortree_cpp

ROS Distro
noetic

Package Summary

Version 4.10.0
License MIT
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/BehaviorTree/BehaviorTree.CPP.git
VCS Type git
VCS Version master
Last Updated 2026-07-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

This package provides the Behavior Trees core library.

Maintainers

  • Davide Faconti

Authors

  • Davide Faconti

License MIT conan Ubuntu conan Windows ros2 pixi (Conda) Coverage Status

BehaviorTree.CPP 4.9

This C++ 17 library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use, reactive and fast.

Even if our main use-case is robotics, you can use this library to build AI for games, or to replace Finite State Machines.

There are a few features that make BehaviorTree.CPP unique, when compared to other implementations:

  • It makes asynchronous Actions, i.e. non-blocking, a first-class citizen.

  • You can build reactive behaviors that execute multiple Actions concurrently (orthogonality).

  • Trees are defined using a Domain Specific scripting language (based on XML), and can be loaded at run-time; in other words, even if written in C++, the morphology of the Trees is not hard-coded.

  • You can statically link your custom TreeNodes or convert them into plugins and load them at run-time.

  • It provides a type-safe and flexible mechanism to do Dataflow between Nodes of the Tree.

  • It includes a logging/profiling infrastructure that allows the user to visualize, record, replay, and analyze state transitions.

Documentation

  • Tutorials and general documentation: https://www.behaviortree.dev/
  • Auto-generated Doxygen: https://behaviortree.github.io/BehaviorTree.CPP/
  • Community support and forum: https://github.com/BehaviorTree/BehaviorTree.CPP/discussions

GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.

If you are looking for a fancier graphical user interface (and I know you do) check Groot2 out.

Groot screenshot

How to compile

BT.CPP requires a compiler that supports C++17.

Three build systems are supported:

  • colcon (ament), if you use ROS2
  • conan otherwise (Linux/Windows).
  • straight cmake if you want to be personally responsible for dependencies :)

Compiling with conan:

[!NOTE] Conan builds require CMake 3.23 or newer.

Assuming that you are in the root directory of BehaviorTree.CPP:

conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

If you have dependencies such as ZeroMQ and SQlite already installed and you don’t want to use conan, simply type:

mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

If you want to build in a pixi project (conda virtual environment).

pixi run build

If you want to use BT.CPP in your application, please refer to the example here: https://github.com/BehaviorTree/btcpp_sample .

Installing BehaviorTree.CPP (vcpkg)

Alternatively, you can build and install behaviortree-cpp using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install behaviortree-cpp

The behaviortree-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package behaviortree_cpp

4.10.0 (2026-07-24)

  • reject trailing characters in SwitchNode numeric comparison (#1178)

  • Pin ament install destinations to lib/include/bin (fixes #1175) (#1176) The ROS build farm (bloom/debhelper) configures with -DCMAKE_INSTALL_LIBDIR=lib/<multiarch-triplet>. Since #1152 made the BTCPP_*_DESTINATION variables honor GNUInstallDirs, farm binaries installed libbehaviortree_cpp.so to /opt/ros/<distro>/lib/x86_64-linux-gnu, which breaks ament_export_libraries lookup in downstream packages and is not on the LD_LIBRARY_PATH set by the ament environment hooks. Shadow the cache variables with plain set() in the ament build path, so ROS builds always install to $prefix/lib regardless of CMAKE_INSTALL_LIBDIR, while standalone builds keep the GNUInstallDirs override behavior introduced for #1120. Also add a ros2-lyrical CI job that emulates the build farm flags and asserts the library lands in $prefix/lib. Co-authored-by: Claude Fable 5 <<noreply@anthropic.com>>

  • fix out-of-bounds read in Groot2 hook insert handler (#1170)

    • fix out-of-bounds read in Groot2 hook insert handler
    • exclude Parallel.FailingParallel from macOS CI test run
  • Add scripted return status support for TestNode mocks (#1169) Introduce [return_status_script]{.title-ref} on TestNodeConfig, allowing a mock's completion status to be computed at runtime from blackboard state instead of being fixed. When set, it takes precedence over [return_status]{.title-ref}; it may reference the NodeStatus names (SUCCESS/FAILURE/...) and is rejected if it resolves to IDLE. The NodeStatus enum names are injected only into the return_status_script environment. The pre-existing success_script/failure_script/post_script continue to evaluate against the node's own enums, so a blackboard entry named like a status (e.g. "SUCCESS") is not shadowed. To pay the ABI break only once, TestNode's state is moved behind a PImpl, so future changes to it no longer alter the layout consumers link against (mirroring StatusChangeLogger). The new return_status_script field is appended at the end of TestNodeConfig, preserving the byte offsets of the existing fields. Also add JSON validation rejecting a TestNodeConfig with neither a return_status nor a return_status_script, and a tutorial example (t15_nodes_mocking_strict_failure) demonstrating the strict-failure flow. Addresses #995. Co-authored-by: Pepe <<pepe@ross-robotics.co.uk>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Fix ROOT blackboard export in Groot2 publisher (#1132) (#1168) When a subtree's blackboard is backed by a separate root blackboard (e.g. created via [Blackboard::create(external_root)]{.title-ref} to expose [@]{.title-ref} globals), the Groot2 publisher never exported those root entries, so they were invisible in Groot2. Export the root blackboard under the reserved name [ROOT]{.title-ref} whenever a requested subtree resolves to a distinct root blackboard.

    - Deduplicate the [ROOT]{.title-ref} payload when several subtrees share the same root blackboard.

    - Return the dump as [Expected<>]{.title-ref} and send an error reply for ambiguous requests: a subtree literally named [ROOT]{.title-ref}, or a request spanning multiple distinct root blackboards.

    - Add functional coverage to gtest_groot2_publisher_integration.cpp using the shared Groot2Test helpers (makePublisher/Client).

    - Enable [/utf-8]{.title-ref} for behaviortree_cpp_test on MSVC so the Unicode name-validation tests build on Windows. Closes #1130 Co-authored-by: magic-alt <<zaqwerss@outlook.com>> Co-authored-by: Claude Opus 4.8 <<noreply@anthropic.com>>

  • Add macOS CI and fix Apple libc++ build (#1167)

    * Add macOS build to CI Add a Conan + CMake workflow running on macos-latest (Apple Silicon, AppleClang + libc++). This exercises the Apple standard-library toolchain that other CI jobs (Ubuntu/GCC, Windows/MSVC, conda/Clang) do not, catching Apple-specific breakage such as the missing floating-point std::from_chars. The job mirrors the existing cmake_ubuntu.yml Conan flow (conan install -> cmake --preset conan-release -> ctest), pinning compiler.cppstd=17 as the Windows job does. Co-Authored-By: Claude Opus 4.8 <<noreply@anthropic.com>>

    * Fix Apple libc++ build: guard floating-point std::from_chars Apple's libc++ deletes the floating-point std::from_chars overload (and undefines __cpp_lib_to_chars), so the unguarded double parse

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged behaviortree_cpp at Robotics Stack Exchange