Skip to main content

Library to load XML behavior trees done using Groot GUI (https://github.com/BehaviorTree/Groot) into the py_trees library (https://github.com/splintered-reality/py_trees)

Project description

Import Groot XML files into py_trees

Groot is a Graphical Editor, written in C++ and Qt, to create BehaviorTrees. It is only compatible with BehaviorTree.CPP. This module is an attempt to use Groot to generate trees using py_trees instead of BehaviorTree.CPP.

Groot supported features

BehaviorTree.CPP and py_trees use different control sequences, decorators and tree leaves. This section explains the mapping between one and the other in order to use Groot in py_trees.

Control nodes to Composite nodes:

Groot py_trees
Sequence Sequence with memory=True
ReactiveSequence Sequence with memory=False
Fallback Selector with memory=True
ReactiveFallback Selector with memory=False
Parallel with success_threshold=1 Parallel with policy=SuccessOnOne
Parallel with success_threshold <> 1 Parallel with policy=SuccessOnAll
IfThenElse not available
WhileDoElse not available
SwitchX not available

Decorators to Decorators

Groot py_trees
Timeout Timeout
ForceFailure SuccessIsFailure
ForceSuccess FailureIsSuccess
Inverter Inverter
BlackboardCheckX EternalGuard?
KeepRunningUntilFailure Condition?
Repeat not available
RetryUntilSuccessful not available
Delay not available
User defined Decorator Decorator in decorators

Additional py_trees decorators, both core defined as OneShot, StatusToBlackboard, FailureIsRunning, RunningIsSuccess... or newly created by the user, must be added in the decorators diccionare and pass to the load function to be used.

Actions and Conditions to Behaviors

Groot py_trees
AlwaysFailure Failure
AlwaysSuccess Success
SetBlackBoard SetBlackboardVariable output_key=value
user defined Action Behavior in user_behaviors
user defined Condition Behavior in user_behaviors

All manually defined Actions and Conditions in Groot have to be defined as py_trees behaviors and added into the behaviors list in function load to be used.

Example

from py_trees_meet_groot import groot_xml

all_behaviors = [behavior1, behavior2, ...]
all_decorators = [decorator1, decorato2, ...]
root = groot_xml.load("GROOT_XML_FILE_TO_LOAD.xml", behaviors=all_behaviors, decorators=all_decorators)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_trees_meet_groot-0.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_trees_meet_groot-0.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file py_trees_meet_groot-0.2.tar.gz.

File metadata

  • Download URL: py_trees_meet_groot-0.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for py_trees_meet_groot-0.2.tar.gz
Algorithm Hash digest
SHA256 82a0109290aff44dcd84eda99a25a50d5f247cb06e7bfb7def885ffe9856cd3a
MD5 8aedf0d4de15dd815b5cc6473e1535e1
BLAKE2b-256 2b327a793d7d64e497412ca6492ecff57c92f0212240badb36b8e27ea6237b06

See more details on using hashes here.

File details

Details for the file py_trees_meet_groot-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for py_trees_meet_groot-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 97e17c85e18e6744f9d7c08df51045222dae7f36a536145fd7a1f3f97e14d048
MD5 d7545dbc305bc9f7e5e406ce80cf1968
BLAKE2b-256 aad503fcbde0e6c3455070c544f3205dd98c893aaa88c4695218096a618c082a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page