Skip to content

Possibility for multiple BT nodes in same class #610

Closed Answered by facontidavide
jonatansw asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

you have two approaches!

First, check this, since it does exactly what you mention. https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/sample_nodes/crossdoor_nodes.h

On the other hand, its limitation is that these are simple nodes without Ports.

A better, but more verbose alternative, is passing the class with the shared state as a third argument, as explained in tutorial 8:

https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/examples/t08_additional_node_args.cpp

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by facontidavide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants