Skip to content

Commit 8db5593

Browse files
committed
Merge branch 'master' of github.com:BehaviorTree/BehaviorTree.CPP
2 parents 73835f1 + 59c1a80 commit 8db5593

File tree

7 files changed

+31
-22
lines changed

7 files changed

+31
-22
lines changed

.github/workflows/cmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ jobs:
4848
- name: run test (Linux)
4949
if: matrix.os == 'ubuntu-latest'
5050
working-directory: ${{github.workspace}}/build
51-
run: ./bin/behaviortree_cpp_v3_test
51+
run: ./tests/behaviortree_cpp_v3_test
5252

CMakeLists.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ option(BUILD_SAMPLES "Build sample nodes" ON)
2323
option(BUILD_UNIT_TESTS "Build the unit tests" ON)
2424
option(BUILD_TOOLS "Build commandline tools" ON)
2525
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
26+
option(BUILD_MANUAL_SELECTOR "Build manual selector node" ON)
2627
option(ENABLE_COROUTINES "Enable boost coroutines" ON)
2728

2829
#---- Include boost to add coroutines ----
@@ -166,14 +167,17 @@ list(APPEND BT_SOURCE
166167
3rdparty/minitrace/minitrace.cpp
167168
)
168169

169-
find_package(Curses QUIET)
170-
171-
if(CURSES_FOUND)
172-
list(APPEND BT_SOURCE
173-
src/controls/manual_node.cpp
174-
)
175-
list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES ${CURSES_LIBRARIES})
176-
add_definitions(-DNCURSES_FOUND)
170+
if(BUILD_MANUAL_SELECTOR)
171+
find_package(Curses QUIET)
172+
if(CURSES_FOUND)
173+
list(APPEND BT_SOURCE
174+
src/controls/manual_node.cpp
175+
)
176+
list(APPEND BEHAVIOR_TREE_PUBLIC_LIBRARIES ${CURSES_LIBRARIES})
177+
add_definitions(-DNCURSES_FOUND)
178+
else()
179+
message(WARNING "NCurses NOT found. Skipping the build of manual selector node.")
180+
endif()
177181
endif()
178182

179183

@@ -252,16 +256,12 @@ else()
252256
set( BEHAVIOR_TREE_INC_DESTINATION include )
253257
set( BEHAVIOR_TREE_BIN_DESTINATION bin )
254258

255-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BEHAVIOR_TREE_BIN_DESTINATION}" )
256-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BEHAVIOR_TREE_LIB_DESTINATION}" )
257-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BEHAVIOR_TREE_BIN_DESTINATION}" )
258259
endif()
259260

260261
message( STATUS "BEHAVIOR_TREE_LIB_DESTINATION: ${BEHAVIOR_TREE_LIB_DESTINATION} " )
261262
message( STATUS "BEHAVIOR_TREE_BIN_DESTINATION: ${BEHAVIOR_TREE_BIN_DESTINATION} " )
262-
message( STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} " )
263-
message( STATUS "CMAKE_LIBRARY_OUTPUT_DIRECTORY: ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} " )
264-
message( STATUS "CMAKE_ARCHIVE_OUTPUT_DIRECTORY: ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} " )
263+
message( STATUS "BUILD_UNIT_TESTS: ${BUILD_UNIT_TESTS} " )
264+
265265

266266
######################################################
267267
# Samples

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
![License MIT](https://img.shields.io/github/license/BehaviorTree/BehaviorTree.CPP?color=blue)
2-
![Version](https://img.shields.io/badge/version-3.6-blue.svg)
2+
![Version](https://img.shields.io/badge/version-3.7-blue.svg)
33
[![cmake](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/cmake.yml/badge.svg)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/cmake.yml)
44
[![ros1](https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros1/badge.svg?branch=master)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros1)
55
[![ros2](https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros2/badge.svg?branch=master)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros2)
66
[![LGTM Grade](https://img.shields.io/lgtm/grade/cpp/github/BehaviorTree/BehaviorTree.CPP)](https://lgtm.com/projects/g/BehaviorTree/BehaviorTree.CPP/context:cpp)
7-
[![Join the chat at https://gitter.im/BehaviorTree-ROS/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/BehaviorTree-ROS/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge)
7+
![Discourse topics](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fdiscourse.behaviortree.dev)
88

99
# BehaviorTree.CPP
1010

docs/tutorial_05_subtrees.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ It is also the first practical example that uses `Decorators` and `Fallback`.
4444
</root>
4545
```
4646

47-
It may be noticed that we incapsulated a quite complex branch of the tree,
47+
For readability, our custom nodes are registered with the one-liner:
48+
49+
`CrossDoor::RegisterNodes(factory);`
50+
51+
Default nodes provided by the BT library such as `Fallback` are already registered by
52+
the BehaviorTreeFactory.
53+
54+
It may be noticed that we encapsulated a quite complex branch of the tree,
4855
the one to execute when the door is closed, into a separate tree called
4956
`DoorClosed`.
5057

examples/t05_crossdoor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ int main(int argc, char** argv)
6161
{
6262
BT::BehaviorTreeFactory factory;
6363

64-
// register all the actions into the factory
64+
// Register our custom nodes into the factory.
65+
// Any default nodes provided by the BT library (such as Fallback) are registered by
66+
// default in the BehaviorTreeFactory.
6567
CrossDoor::RegisterNodes(factory);
6668

6769
// Important: when the object tree goes out of scope, all the TreeNodes are destroyed

src/loggers/bt_zmq_publisher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ PublisherZMQ::PublisherZMQ(const BT::Tree& tree,
9191
PublisherZMQ::~PublisherZMQ()
9292
{
9393
active_server_ = false;
94-
zmq_->context.shutdown();
9594
if (thread_.joinable())
9695
{
9796
thread_.join();
9897
}
9998
flush();
99+
zmq_->context.shutdown();
100100
delete zmq_;
101101
ref_count = false;
102102
}

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ elseif(BUILD_UNIT_TESTS)
6262
add_custom_command(TARGET ${BEHAVIOR_TREE_LIBRARY}_test POST_BUILD
6363
COMMAND ${CMAKE_COMMAND} -E copy_directory
6464
${CMAKE_SOURCE_DIR}/tests/trees
65-
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/trees)
65+
trees)
6666

67-
add_test(BehaviorTreeCoreTest ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BEHAVIOR_TREE_LIBRARY}_test)
67+
add_test(BehaviorTreeCoreTest ${BEHAVIOR_TREE_LIBRARY}_test)
6868

6969
endif()

0 commit comments

Comments
 (0)