miccol / behavior-tree Goto Github PK
View Code? Open in Web Editor NEWA lightweight library of Behavior Trees Library in C++.
License: MIT License
A lightweight library of Behavior Trees Library in C++.
License: MIT License
Hi,
first of all, thanks for making this code available.
If I can make a suggestions, there are few coding styles that can help improving the maintenability and readability of the code.
Don't expose constants such has the node name and type as public member.
You don't want the user to be able to change them. Make the private and provide public getters.
use naming conventions instead of CamelCase everywhere. I would recommend https://google.github.io/styleguide/cppguide.html
Remove the member NodeType Type. You are just duplicating the information with no real benefit for maintainers and users.
I am working on these improvements here: https://github.com/facontidavide/Behavior-Tree
Regards
Davide
Hello there,
the build instructions given on Readme.md
fail on Unbuntu 16.04 after installing the listed dependencies (GL
, GLUT
and googletest
). CMake aborts with the following output:
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found GTest: /usr/local/lib/libgtest.a
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GLUT_Xmu_LIBRARY (ADVANCED)
linked by target "btpp_gtest" in directory /home/bowman/Sandboxes/libbtpp
linked by target "btpp_example" in directory /home/bowman/Sandboxes/libbtpp
linked by target "BTpp" in directory /home/bowman/Sandboxes/libbtpp
The error is obscure, but fortunately well documented. Following the advice given in the link, namely to install the packages libxmu-dev
and libxi-dev
allows CMake to succeed.
I'd advise to add a note on this to the README.md
file, for future reference.
Thanks a lot for making the library available @miccol!
I think we should look for a better visualization.
Hi;
I have been taking a look in this project code these days... The organization of the code is great, by the way. However, I realized there are some header files missing. For instance, there is no "Action/ActionNodeTemplate.h". So, I would like to know if there is any plan of yours for continuing improving the project any time soon.
Regards.
Hi Michele,
I am new to BTs and AI in general so let me say your book as been extremely helpful. I am trying to understand the design principle "Improving Reactivity using Implicit Sequences". Figure 3.3:
This is Figure 3.2 rearranged so that if the agent has already passed through the door, it doesn't try to open or unlock the door. What I don't understand in Figure 3.3 is that if the Open Door action returns success then the whole fallback node would return success and the agent never passes through the door. Same with unlocking the door--the unlock action (if performed) would return success when complete causing the fallback node to return success even though the agent never opened the door or went though it. It almost seems like it should be like this:
which follows the PPA methodology nicely. Am I missing something? Thanks again--this is awesome!
Jason
your source code is dependent on xlib. But in windows OS that is not supported. Can you fix it?
Hi,
I noticed that a single thread is created for each node. This seems like a waste of resources in large systems with potentially dozens of nodes.
I guess that either a custom (simple) scheduler or a coroutine library might be able to do the job.
Considering the overhead of the context switching, I have the feeling that even traversing the entire tree might be faster.
Is there any reason I am not aware of to use a separate thread per node?
Cheers
Davide
In the example, it uses a while loop to continually execute whatever the action does while it's running. What's the reason this should be done rather than an if statement that is executed once for each tick?
Hi Michele,
I noticed you mentioned :
"I am in contact with the developer of Behavior3.com I also had in mind of doing a parsing from JSON files"
I am thinking to do the same, and I would like (if you want) to collaborate this time and avoid replicated work.
Few preliminary thoughts:
I have a design in mind, but I wonder if you already have some idea or not about it.
This is a heads up about something that I want to discuss in more detail in a future PR.
I am looking at the code of the main ControlNodes and I am trying to understand what happens when a child returns RUNNING.
Apparently, when a child returns RUNNING, these Nodes halt the following children.
On the other hand, FallbackNodeWithMemory and SequenceNodeWithMemory never invoke haltChildren, in any case.
Is that intentional?
In my opinion:
After completing the build, the command
sudo make install
fails with the following output
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/BTpp/libBTpp.a
-- Installing: /usr/local/lib/BTpp/btpp-targets.cmake
-- Installing: /usr/local/lib/BTpp/btpp-targets-release.cmake
CMake Error at cmake_install.cmake:59 (file):
file INSTALL cannot find
"/home/bowman/Sandboxes/libbtpp/btpp-config.cmake".
Makefile:61: recipe for target 'install' failed
Looks like the support for pkg-config
is not complete in the master
branch?
PS: Also, the installation rules for headers seem to be broken/incomplete on master
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.