Open naveedhd opened 7 years ago
I have no strong objections. Python should still be the first class citizen, but there are cases requiring serializable formats. YAML is ok, JSON might be an alternative so you can communicate with web apps (e.g. behaviour3's JSON format, check out the editor.
Other thoughts:
py_trees.composites.Parallel
Just some notes:
The lads here at TRI have been playing around with the idea of serialising the recipe for construction of a py_tree
(note this is different than serialising the snapshot of a py_tree). This would serve some useful workflows:
If just doing it for minimising scripting boilerplate ... the python code is already actually super minimal. For a simple script, you're only adding a few lines extra to tick/render it and in some cases, saving effort by creating similar behaviours in a loop.
Both of the workflows above could, ostensibly, generate python code, but that is typically harder to do versioning on (and automatic upgrades of older version files lying around). Another benefit is that it could be used to generate the behaviour trees in a different language if ever this library decided to try it's hand at supporting it's implementations across languages (c++, javascript, ...).
In BehaviorTree.CPP we did something similar, using XML as "scripting language".
To give you an idea of what it look like.... https://www.behaviortree.dev/xml_format/
I have created an xml parser for py_trees. It isn't ready to be released just yet, but my intention is to publish the code.
What do you think about the generating trees by parsing yaml file.
something like
I'm not sure if it would be useful for writing big but for small scripts (that I usually write to learn/verify) could be useful.