Skip to content

Commit

Permalink
Modify CMakeLists and README
Browse files Browse the repository at this point in the history
  • Loading branch information
Aoi-hosizora committed May 23, 2021
1 parent 7e67cbf commit 9c0bf43
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 126 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/build*
/test_data/*_test.xml
/test/CMakeLists.txt.user
/bin
/.vscode
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

49 changes: 40 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ endif()

project(groot)

set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}
"D:/Development/Qt/5.15.2/mingw81_64"
# "D:/Development/vcpkg/installed/x64-windows"
)

find_package(Qt5 COMPONENTS Core Widgets Gui OpenGL Xml Svg)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")

Expand Down Expand Up @@ -81,8 +86,14 @@ set(CATKIN_ENABLE_TESTING OFF CACHE BOOL "")

if(NOT catkin_FOUND AND NOT ament_cmake_FOUND)
# look for BehaviorTree.CPP on the system
message(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
# set (BehaviorTreeV3_DIR "E:/Projects/_ref/BehaviorTree.CPP/build")
# set (BehaviorTreeV3_INCLUDE_DIRS "E:/Projects/_ref/BehaviorTree.CPP/include")
# set (BehaviorTreeV3_LIBRARIES "E:/Projects/_ref/BehaviorTree.CPP/build/bin")
# include_directories(${BehaviorTreeV3_INCLUDE_DIRS})
find_package(BehaviorTreeV3)
if (NOT BehaviorTree_FOUND)
message(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
# use git submodule only if you are not compiling with catkin
add_subdirectory( depend/BehaviorTree.CPP )
include_directories( depend/BehaviorTree.CPP/include )
Expand Down Expand Up @@ -125,19 +136,37 @@ set(FORMS_UI
./bt_editor/custom_node_dialog.ui
)

# set (ZMQ_INCLUDE_DIRS "E:/Projects/_ref/libzmq/include")
# set (ZMQ_LIBRARIES "E:/Projects/_ref/libzmq/build/lib")
# include_directories(${ZMQ_INCLUDE_DIRS})

find_package(ZMQ)

if( ZMQ_FOUND )
message(STATUS "ZeroMQ found.")
add_definitions( -DZMQ_FOUND )
if (NOT ZMQ_FOUND)
add_subdirectory( depend/libzmq )
include_directories( depend/libzmq/include )

set(APP_CPPS ${APP_CPPS} ./bt_editor/sidepanel_monitor.cpp )
set(FORMS_UI ${FORMS_UI} ./bt_editor/sidepanel_monitor.ui )
add_subdirectory( depend/cppzmq )
include_directories( depend/cppzmq )

else()
message(WARNING "ZeroMQ NOT found. Real-time monitoring disabled.")
set(ZMQ_FOUND TRUE)
endif()

add_definitions( -DZMQ_FOUND )
set(APP_CPPS ${APP_CPPS} ./bt_editor/sidepanel_monitor.cpp )
set(FORMS_UI ${FORMS_UI} ./bt_editor/sidepanel_monitor.ui )

# if( ZMQ_FOUND )
# message(STATUS "ZeroMQ found.")
# add_definitions( -DZMQ_FOUND )

# set(APP_CPPS ${APP_CPPS} ./bt_editor/sidepanel_monitor.cpp )
# set(FORMS_UI ${FORMS_UI} ./bt_editor/sidepanel_monitor.ui )

# else()
# message(WARNING "ZeroMQ NOT found. Real-time monitoring disabled.")
# endif()

QT5_WRAP_UI(FORMS_HEADERS ${FORMS_UI})

add_library(behavior_tree_editor SHARED
Expand All @@ -160,12 +189,14 @@ if( ZMQ_FOUND )
endif()

target_link_libraries(behavior_tree_editor ${GROOT_DEPENDENCIES} )
# target_link_libraries(behavior_tree_editor QtNodeEditor behaviortree_cpp_v3)


add_executable(Groot ./bt_editor/main.cpp ${RESOURCE_FILES})
target_link_libraries(Groot behavior_tree_editor )
# target_link_libraries(Groot behavior_tree_editor )
target_link_libraries(Groot behaviortree_cpp_v3 behavior_tree_editor )

add_subdirectory(test)
# add_subdirectory(test)

######################################################
# INSTALL
Expand Down
102 changes: 17 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,23 @@
[![Build Status](https://travis-ci.org/BehaviorTree/Groot.svg?branch=master)](https://travis-ci.org/BehaviorTree/Groot)
# Groot (forked)

# Groot
+ This is a forked modified Groot repo by [Aoi-hosizora](https://github.com/Aoi-hosizora). This is used by SCUT xxx (private) project.
+ For old README, please visit [README_old.md](./README_old.md).
+ Note that depended [BehaviorTree.CPP](https://github.com/BehaviorTree/BehaviorTree.CPP), [cppzmq](https://github.com/zeromq/cppzmq) and [libzmq](https://github.com/zeromq/libzmq) are all submodule-deinited.

**Groot** is a Graphical Editor, written in C++ and Qt, to create [BehaviorTrees](https://en.wikipedia.org/wiki/Behavior_tree).
## Build Groot in Windows and MinGW-x64

It is compliant with the the library [BehaviorTree.CPP](https://github.com/BehaviorTree/BehaviorTree.CPP).
```bash
# Change to Your Qt path (line 12)
vim CMakeLists.txt

[![Groot Editor](groot-screenshot.png)](https://vimeo.com/275066768)
set PATH=D:\Development\Qt\5.15.2\mingw81_64\bin;%PATH%
mkdir build
cd build

cmake .. -G "MinGW Makefiles"
make -j8

In the following video you can see how the C++ library and
the graphic user interface are used to design and monitor a Behavior Tree.

[![MOOD2Be](video_MOOD2Be.png)](https://vimeo.com/304651183)


# Does your company use BehaviorTree.CPP and Groot?

No company, institution or public/private funding is currently supporting the development of BehaviorTree.CPP and Groot. As a consequence, my time to support **BehaviorTree.CPP** is very limited and I decided that I won't spend any time at all supporting **Groot**.
Pull Requests are welcome and will be reviewed, even if with some delay.

If your company use this software, consider becoming a **sponsor** to support bug fixing and development of new features. You can find contact details in [package.xml](package.xml).

# Dependencies, Installation, and Usage

To compile the project you need:

- [CMake 3.2](https://cmake.org/download)
- Qt5 (tested with version 5.5.1), including the SVG module.

On Ubuntu Xenial or later, you can install the dependencies with:

sudo apt install qtbase5-dev libqt5svg5-dev libzmq3-dev libdw-dev
Some functionalities of the code related to ROS will work __only__ if the
project is compiled with with _catkin_.

# Compilation instructions (Linux)

git clone https://github.com/BehaviorTree/Groot.git
cd Groot
git submodule update --init --recursive
mkdir build; cd build
cmake ..
make
Note compiling "in-source" is not allowed.

# Compilation instructions (ROS)

mkdir -p catkin_ws/src
cd catkin_ws/src
git clone https://github.com/BehaviorTree/Groot.git
cd ..
rosdep install --from-paths src --ignore-src
catkin_make

# Licence

Copyright (c) 2018-2019 FUNDACIO EURECAT

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


# Acknowledgment

This project is one of the main components of [MOOD2Be](https://eurecat.org/es/portfolio-items/mood2be/),
and it is developed at [Eurecat](https://eurecat.org) by Davide Faconti.

MOOD2Be is one of the six **Integrated Technical Projects (ITPs)** selected from the [RobMoSys first open call](https://robmosys.eu/itp/).

It received funding from the European Union’s Horizon 2020 Research and Innovation Programme
under the RobMoSys project.

# make 中途可能会报未找到 `-lzmq` 的错误
# 需要把已经编译出来的 build\depend\libzmq\lib 的 libzmq.a 和 libzmq.dll.a 复制到 mingw 的 lib 下,然后继续编译即可
# xxx\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\lib
```
91 changes: 91 additions & 0 deletions README_old.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
[![Build Status](https://travis-ci.org/BehaviorTree/Groot.svg?branch=master)](https://travis-ci.org/BehaviorTree/Groot)

# Groot

**Groot** is a Graphical Editor, written in C++ and Qt, to create [BehaviorTrees](https://en.wikipedia.org/wiki/Behavior_tree).

It is compliant with the the library [BehaviorTree.CPP](https://github.com/BehaviorTree/BehaviorTree.CPP).

[![Groot Editor](groot-screenshot.png)](https://vimeo.com/275066768)


In the following video you can see how the C++ library and
the graphic user interface are used to design and monitor a Behavior Tree.

[![MOOD2Be](video_MOOD2Be.png)](https://vimeo.com/304651183)


# Does your company use BehaviorTree.CPP and Groot?

No company, institution or public/private funding is currently supporting the development of BehaviorTree.CPP and Groot. As a consequence, my time to support **BehaviorTree.CPP** is very limited and I decided that I won't spend any time at all supporting **Groot**.
Pull Requests are welcome and will be reviewed, even if with some delay.

If your company use this software, consider becoming a **sponsor** to support bug fixing and development of new features. You can find contact details in [package.xml](package.xml).

# Dependencies, Installation, and Usage

To compile the project you need:

- [CMake 3.2](https://cmake.org/download)
- Qt5 (tested with version 5.5.1), including the SVG module.

On Ubuntu Xenial or later, you can install the dependencies with:

sudo apt install qtbase5-dev libqt5svg5-dev libzmq3-dev libdw-dev
Some functionalities of the code related to ROS will work __only__ if the
project is compiled with with _catkin_.

# Compilation instructions (Linux)

git clone https://github.com/BehaviorTree/Groot.git
cd Groot
git submodule update --init --recursive
mkdir build; cd build
cmake ..
make
Note compiling "in-source" is not allowed.

# Compilation instructions (ROS)

mkdir -p catkin_ws/src
cd catkin_ws/src
git clone https://github.com/BehaviorTree/Groot.git
cd ..
rosdep install --from-paths src --ignore-src
catkin_make

# Licence

Copyright (c) 2018-2019 FUNDACIO EURECAT

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


# Acknowledgment

This project is one of the main components of [MOOD2Be](https://eurecat.org/es/portfolio-items/mood2be/),
and it is developed at [Eurecat](https://eurecat.org) by Davide Faconti.

MOOD2Be is one of the six **Integrated Technical Projects (ITPs)** selected from the [RobMoSys first open call](https://robmosys.eu/itp/).

It received funding from the European Union’s Horizon 2020 Research and Innovation Programme
under the RobMoSys project.

3 changes: 3 additions & 0 deletions depend/BehaviorTree.CPP/3rdparty/minitrace/minitrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#include <stdio.h>
#include <string.h>

#define __STDC_FORMAT_MACROS
#include <inttypes.h>

#ifdef _WIN32
#pragma warning (disable:4996)
#define WIN32_LEAN_AND_MEAN
Expand Down
5 changes: 2 additions & 3 deletions depend/BehaviorTree.CPP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()

add_definitions(-Wpedantic)

#---- Include boost to add coroutines ----
find_package(Boost COMPONENTS coroutine QUIET)

Expand Down Expand Up @@ -42,7 +40,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)

#---- project configuration ----
option(BUILD_EXAMPLES "Build tutorials and examples" ON)
option(BUILD_UNIT_TESTS "Build the unit tests" ON)
option(BUILD_UNIT_TESTS "Build the unit tests" OFF)
option(BUILD_TOOLS "Build commandline tools" ON)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)

Expand Down Expand Up @@ -235,6 +233,7 @@ if( ZMQ_FOUND )
endif()

if(MSVC)
target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE /W3 /WX)
else()
target_compile_options(${BEHAVIOR_TREE_LIBRARY} PRIVATE
-Wall -Wextra -Werror=return-type)
Expand Down
18 changes: 9 additions & 9 deletions depend/cppzmq/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libzmq-pkg-config/FindZeroMQ.cmake
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR}/libzmq-pkg-config)

option(CPPZMQ_BUILD_TESTS "Whether or not to build the tests" ON)

if (CPPZMQ_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
if (CMAKE_CXX_STANDARD AND NOT CMAKE_CXX_STANDARD EQUAL 98 AND CMAKE_CXX_STANDARD GREATER_EQUAL 11)
add_subdirectory(examples)
endif()
endif()
# option(CPPZMQ_BUILD_TESTS "Whether or not to build the tests" OFF)

# if (CPPZMQ_BUILD_TESTS)
# enable_testing()
# add_subdirectory(tests)
# if (CMAKE_CXX_STANDARD AND NOT CMAKE_CXX_STANDARD EQUAL 98 AND CMAKE_CXX_STANDARD GREATER_EQUAL 11)
# add_subdirectory(examples)
# endif()
# endif()
Loading

0 comments on commit 9c0bf43

Please sign in to comment.