Skip to content

Commit 3c855ec

Browse files
cktiicktii
and
cktii
authored
feat: initial integration behaviortreecpp (#13008)
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 <[email protected]>
1 parent 1ea07fc commit 3c855ec

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed

projects/behaviortreecpp/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
################################################################################
16+
17+
FROM gcr.io/oss-fuzz-base/base-builder
18+
RUN apt-get update && apt-get install -y make autoconf automake libtool cmake pkg-config wget libsodium-dev
19+
RUN git clone --depth 1 https://github.com/BehaviorTree/BehaviorTree.CPP.git behaviortreecpp
20+
WORKDIR behaviortreecpp
21+
COPY build.sh $SRC/

projects/behaviortreecpp/build.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash -eu
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
18+
# ===== BUILD Sqlite =====
19+
SQLITE_VER=sqlite-autoconf-3480000
20+
21+
wget https://www.sqlite.org/2025/${SQLITE_VER}.tar.gz
22+
tar xzf ${SQLITE_VER}.tar.gz
23+
cd ${SQLITE_VER}
24+
./configure --enable-static --disable-shared
25+
make -j"$(nproc)"
26+
make install
27+
cd ..
28+
29+
# ===== BUILD zeroMQ =====
30+
git clone https://github.com/zeromq/libzmq.git
31+
cd libzmq
32+
mkdir build && cd build
33+
cmake .. -DBUILD_SHARED=OFF -DBUILD_STATIC=ON -DZMQ_BUILD_TESTS=OFF
34+
make -j"$(nproc)"
35+
make install
36+
cd ../..
37+
38+
# ===== Build BehaviorTree.CPP =====
39+
mkdir build && cd build
40+
41+
CMAKE_FLAGS=(
42+
"-DCMAKE_BUILD_TYPE=Release"
43+
"-DENABLE_FUZZING=ON"
44+
"-DFORCE_STATIC_LINKING=ON"
45+
)
46+
47+
cmake .. "${CMAKE_FLAGS[@]}"
48+
make -j"$(nproc)"
49+
50+
for fuzzer in bt_fuzzer script_fuzzer bb_fuzzer; do
51+
cp $fuzzer "$OUT/"
52+
53+
if [ -d ../fuzzing/corpus/${fuzzer} ]; then
54+
zip -j "$OUT/${fuzzer}_seed_corpus.zip" ../fuzzing/corpus/${fuzzer}/*
55+
fi
56+
done

projects/behaviortreecpp/project.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
homepage: "https://www.behaviortree.dev/"
2+
language: c++
3+
primary_contact: "[email protected]"
4+
main_repo: "https://github.com/BehaviorTree/BehaviorTree.CPP"
5+
file_github_issue: true
6+
vendor_ccs:
7+
8+
fuzzing_engines:
9+
- libfuzzer
10+
- afl
11+
sanitizers:
12+
- address
13+
- undefined

0 commit comments

Comments
 (0)