splintered-reality / py_trees_ros

ROS extensions and implementations for py_trees
Other
143 stars 40 forks source link

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

Closed sea-bass closed 1 year ago

sea-bass commented 1 year ago

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.
stonier commented 1 year ago

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