You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want the node "SetBlackboardValue" to repeat 3 times. But it only runs once and the tree finishes execution. Is there something I am doing wrong here?
###################
import py_trees
from py_trees.decorators import Repeat
class SetBlackboardValue(py_trees.behaviour.Behaviour):
def init(self, name):
super().init(name)
repeat_behavior = Repeat(
name="Repeat",
child=SetBlackboardValue("Set Blackboard Value"),
num_success=3 # Set the number of times to repeat the node
)
root.add_child(repeat_behavior)
return root
def main():
behavior_tree = create_behavior_tree()
tree = py_trees.trees.BehaviourTree(behavior_tree)
try:
print("Behavior Tree Execution:")
tree.setup(timeout=15)
tree.tick()
# pass
# while tree.tick():
# pass
finally:
print("Behavior Tree Finished")
if name == "main":
main()
The text was updated successfully, but these errors were encountered:
I want the node "SetBlackboardValue" to repeat 3 times. But it only runs once and the tree finishes execution. Is there something I am doing wrong here?
###################
import py_trees
from py_trees.decorators import Repeat
class SetBlackboardValue(py_trees.behaviour.Behaviour):
def init(self, name):
super().init(name)
def create_behavior_tree():
root = py_trees.composites.Sequence("Behavior Tree", False)
def main():
behavior_tree = create_behavior_tree()
tree = py_trees.trees.BehaviourTree(behavior_tree)
if name == "main":
main()
The text was updated successfully, but these errors were encountered: