GithubHelp home page GithubHelp logo

miccol / behavior-tree Goto Github PK

View Code? Open in Web Editor NEW
181.0 17.0 46.0 1.29 MB

A lightweight library of Behavior Trees Library in C++.

License: MIT License

CMake 5.27% C++ 93.91% C 0.82%
behavior-tree behavior-trees cpp11

behavior-tree's People

Contributors

cmcghan avatar ewerlopes avatar miccol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

behavior-tree's Issues

coding style

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.

  1. 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.

  2. use naming conventions instead of CamelCase everywhere. I would recommend https://google.github.io/styleguide/cppguide.html

  3. 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

Hiccup building the library on Ubuntu 16.04

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!

Dependencies?

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.

Improving Reactivity using Implicit Sequences is unclear

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:
capture
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:
reactivebt
which follows the PPA methodology nicely. Am I missing something? Thanks again--this is awesome!

Jason

I can't use xilb.

your source code is dependent on xlib. But in windows OS that is not supported. Can you fix it?

Question: is a thread per node really necessary?

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

JSON <-> BT++ convertion

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:

  1. To generate a JSON from a BT++ is pretty easy.
  2. To generate a BT++ from a JSON file is, on the other hand, slightly more complicated, because it requires a proper factory and any user defined action / condition will need to register an allocating method to this factory.

I have a design in mind, but I wonder if you already have some idea or not about it.

ControlNodes and BT::RUNNING

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:

  • Fallback with or without memory should call haltChildren(i+1) only when child return SUCCESS.
  • Sequence with or without memory should call haltChildren(i+1) only when child return FAILURE.

```make install``` rule fails

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.