splintered-reality / py_trees_ros

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

ros action feedback gathering #219

Open kikass13 opened 1 year ago

kikass13 commented 1 year ago

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.

Thanks for the help

Kind regards Nick

kikass13 commented 1 year ago

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,