Possibility for multiple BT nodes in same class #610
-
Hi, First of all, thank you for this amazing library! Regarding a ROS-based system. So the question is; is there a way to have one class that offer multiple BT nodes? Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
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