Skip to content

Commit

Permalink
feat: initial integration behaviortreecpp (#13008)
Browse files Browse the repository at this point in the history
This is an initial integration for BehaviorTree.CPP
([website](https://www.behaviortree.dev/),
[repo](https://github.com/BehaviorTree/BehaviorTree.CPP)) a popular
library that allows to e.g., structure the switching between different
tasks in an autonomous agent, such as a robot or a virtual entity in a
computer game.

This PR can be reviewed but needs to wait until the
BehaviorTree/BehaviorTree.CPP#925 PR is merged
and the harnesses land upstream.

Also, @facontidavide or @miccol either of you as a core-maintainer need
to agree on this onboarding of the project here, so if you do, please
just ACK this.

---------

Co-authored-by: cktii <mytupre@gmail.com>
  • Loading branch information
cktii and cktii authored Mar 3, 2025
1 parent 1ea07fc commit 3c855ec
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/behaviortreecpp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && apt-get install -y make autoconf automake libtool cmake pkg-config wget libsodium-dev
RUN git clone --depth 1 https://github.com/BehaviorTree/BehaviorTree.CPP.git behaviortreecpp
WORKDIR behaviortreecpp
COPY build.sh $SRC/
56 changes: 56 additions & 0 deletions projects/behaviortreecpp/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash -eu
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

# ===== BUILD Sqlite =====
SQLITE_VER=sqlite-autoconf-3480000

wget https://www.sqlite.org/2025/${SQLITE_VER}.tar.gz
tar xzf ${SQLITE_VER}.tar.gz
cd ${SQLITE_VER}
./configure --enable-static --disable-shared
make -j"$(nproc)"
make install
cd ..

# ===== BUILD zeroMQ =====
git clone https://github.com/zeromq/libzmq.git
cd libzmq
mkdir build && cd build
cmake .. -DBUILD_SHARED=OFF -DBUILD_STATIC=ON -DZMQ_BUILD_TESTS=OFF
make -j"$(nproc)"
make install
cd ../..

# ===== Build BehaviorTree.CPP =====
mkdir build && cd build

CMAKE_FLAGS=(
"-DCMAKE_BUILD_TYPE=Release"
"-DENABLE_FUZZING=ON"
"-DFORCE_STATIC_LINKING=ON"
)

cmake .. "${CMAKE_FLAGS[@]}"
make -j"$(nproc)"

for fuzzer in bt_fuzzer script_fuzzer bb_fuzzer; do
cp $fuzzer "$OUT/"

if [ -d ../fuzzing/corpus/${fuzzer} ]; then
zip -j "$OUT/${fuzzer}_seed_corpus.zip" ../fuzzing/corpus/${fuzzer}/*
fi
done
13 changes: 13 additions & 0 deletions projects/behaviortreecpp/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
homepage: "https://www.behaviortree.dev/"
language: c++
primary_contact: "christopher.krah@tii.ae"
main_repo: "https://github.com/BehaviorTree/BehaviorTree.CPP"
file_github_issue: true
vendor_ccs:
- "dfaconti@aurynrobotics.com"
fuzzing_engines:
- libfuzzer
- afl
sanitizers:
- address
- undefined

0 comments on commit 3c855ec

Please sign in to comment.