py_trees icon indicating copy to clipboard operation
py_trees copied to clipboard

Saving Tree & Blackboard State

Open gycn opened this issue 2 years ago • 1 comments

Hi, we're trying to use this library to control a dual arm manipulator to perform an assembly task. Sometimes we'll get errors in the middle of the task due to things like singularities or collisions, and we'll want to restart the task from where we left off. Is it possible to record the state of the tree and the blackboard so that this information is available for us to start in the middle? I saw that there's a Coming Soon section in the tutorials for Bagging Trees which might be relevant.

gycn avatar Mar 08 '22 18:03 gycn

The devil in the detail here - hidden state in behaviours.

Regular py_tree behaviours and user behaviours don't go as far as ensuring that state is exposed, capturable and reconstructable. That would raise the level of complexity of the library rather significantly.

I suspect however, you don't need to capture every single detail of the tree state (and hidden state). You could create your own post-tick handler that captures the few details you need, saves them somewhere if there's been a change and create your own method to recreate the tree from there. This would be wholly or partially application dependent though.

stonier avatar May 30 '22 16:05 stonier