Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't load tree from editor json #3

Open
DIGarnier opened this issue Oct 13, 2017 · 3 comments
Open

Can't load tree from editor json #3

DIGarnier opened this issue Oct 13, 2017 · 3 comments

Comments

@DIGarnier
Copy link

DIGarnier commented Oct 13, 2017

Passing trees made with the online editor containing decorators outputs this:
I'm using python 2.7

Traceback (most recent call last):  File "test.py", line 10, in <module>    tree.load(data_tree)
  File "/home/b3/core/behaviortree.py", line 35, in load
    node = cls()
TypeError: __init__() missing 1 required positional argument: 'child'

The tree in question is this simple one:

tree

It seems like the node's constructor is always being called without children even if it needs one.

@benfrussell
Copy link

I just ran into this issue, did you ever figure out a workaround?

@DIGarnier
Copy link
Author

The workaround would be to build your tree by hand, which I did and it works. I have a project on my github you can peruse if you need inspiration!

@benfrussell
Copy link

benfrussell commented Feb 7, 2018

Digging around the JS version I actually found that all of the decorators have that same child parameter, but defaulted to null. I added the default to None for that parameter in my fork (as well as removing some Python 2 dependencies) and no more problems!

https://github.com/Koraken/behavior3py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants