Conversation
8dbcc42 to
21d450e
Compare
That might be possible, but with the current implementation of C++/Python type interop there are some required additions to the For now, I've at least tried to put everything behind a
In my latest commits, I've added generalized conversions between C++/Python types via the See an example here of passing objects between C++ and Python: https://github.com/BehaviorTree/BehaviorTree.CPP/blob/21d450e880e772c4e3e8a11d865a19d07ce5270d/python_examples/ex05_type_interop.py |
6681c81 to
b425c91
Compare
|
@facontidavide I'm marking this as ready for review, but I've left some "open questions" in the original PR description. The Python bindings are in a pretty usable state at this point. The main missing item is some README-like documentation. |
|
Hi @kylc, this is really amazing. Thanks a lot for the effort. I'm trying to run the examples. Build work fine, but I always get this error when running any example: I checked that |
|
Hi, can we have any estimation on when this PR will be accepted or are there any other plans for the Python support? |
That's odd. I just tried installing in a fresh |
Odd indeed... |
|
Any update on this? |

This PR implements Python bindings to the core BehaviorTree.CPP APIs enabling:
pip install BehaviorTreefrom PyPI, use NumPy and SciPy, etc.)Progress
Core API
BehaviorTreeFactoryTree(minimal API)Node Types
StatefulActionNodeSyncActionNodeCoroActionNode(implemented asAsyncActionNodeusing Python generators)ConditionNode(needed?)ControlNode(needed?)DecoratorNode(needed?)ThreadedAction(won't do, tricky, maybe not the most useful in Python)Interop
py::object-> C++ types (viaJsonExporter::fromJson)BT::Any) ->py::object(viaJsonExporter::toJson)Examples
To run the examples:
python3 -m venv venv && source venv/bin/activatepip install -v .python3 python_examples/ex01_sample.pySee all of the examples under the python_examples/ directory.
Next Steps
pip install BehaviorTreeOpen Questions
TreeNode::getInputmethod.btpybecause that's easy to type.