splintered-reality/py_trees_ros

Consider allowing passing existing ROS2 Node object to `setup()` method of `py_trees_ros.trees.BehaviourTree`

Closed this issue · 1 comments

In py_trees_ros.trees.BehaviourTree, the setup() method always creates a new node named "tree".

I have two requests, which if you agree with, I would be happy to put up a PR:

  1. Can we consider optionally passing in an existing ROS2 node object in setup(), instead of having the tree always create its own node? This allows us to instantiate a ROS enabled BT inside an already created Node (or Node-derived) object.
  2. Right now, the node name is defaulted to "tree". Consider adding an optional argument to change the name, provided an existing node isn't passed in as per the previous item.

Good suggestions, I'll go check out the PR.