Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ros action feedback gathering #219

Open
kikass13 opened this issue Sep 20, 2023 · 1 comment
Open

ros action feedback gathering #219

kikass13 opened this issue Sep 20, 2023 · 1 comment

Comments

@kikass13
Copy link

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

@kikass13
Copy link
Author

kikass13 commented Sep 20, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant