splintered-reality/py_trees_ros

ros action feedback gathering

Opened this issue · 1 comments

hello,

I am trying out the action tutorials on the ros side of this behavior tree framework. So far everything works like usual.

I have a question regarding the design of the action goal on the blackboard of behavior nodes.... as the keys for the blackboard dict seem to be generated with a uuid.

  • 1st, iI don't understand why this exists, because actions (and their names) are unique by design. Is there a reason why this is here instead of the usual action name ? It makes reading those values impossible, because the default implementation has no interface to return that key to the user code

  • 2nd is it possible to add the feedback to the blackboard dict (by default) as well? I am not sure why this is not a thing ... sometimes one might want to react to flags / feedback values when the action is running. And as the main way to get data onto and from the behavior tree seems the blackboard, I think that having feedbacks there as well is kind of important

Thanks for the help

Kind regards
Nick

My workaround in user code looks like this btw:

from tutorial example5

    scan_rotate = None
    def feedbackScan(msg):
        scan_rotate.blackboard.set("scanFeedback", msg.feedback)
        return "{:.2f}%%".format(msg.feedback.percentage_completed)

    scan_rotate = py_trees_ros.actions.ActionClient(
        name="Rotate",
        action_type=py_trees_actions.Rotate,
        action_name="rotate",
        action_goal=py_trees_actions.Rotate.Goal(),  # noqa
        # action_feedback=py_trees_actions.Rotate.Feedback(),  # noqa
        generate_feedback_message=feedbackScan
    )

    scan_rotate.blackboard.register_key("scanFeedback", access=py_trees.common.Access.WRITE)

i added a key to the blackboard and update it with and set the key in some random scan_rotate object (which hopefully is the one create somewhere). This is tedious,

  • the callback function does not know who called it (when callbacks are called, providing self is a nice way do it)
  • the key should exists by default because it is an inherent part of the action anyways
  • I should not have to name the key at all, as an action name is already provided