splintered-reality / py_trees_ros

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

Question about setting up new trees / resetting existing trees #221

Open sea-bass opened 4 months ago

sea-bass commented 4 months ago

I am running into a use case in py_trees (and py_trees_ros) wherein I am ticking a tree to completion and then wanting to "reset" it to start from the beginning.

I can't simply create a new tree and set it up with the same node, because the setup() method tries to redeclare ROS parameters and that is not a happy path. That's easy enough to fix, but maybe not the right approach.

A second thing I tried was to use replace_subtree() on the root node of the tree, manually setting the root's status to INACTIVE, and then ticking to completion again. Which works, but also feels wrong.

And then what if you want to keep the same tree around but simply run it to completion and then reset it multiple times?

So before I try work on some fixes, I wanted to ask if there is some way I am missing to do this all better? Thank you!