splintered-reality/py_trees_ros

running_is_success -> ToBlackboard

Closed this issue · 3 comments

G'day.

Would it be a good idea to have a subscriber behaviour which returns success instead of running whether a message is received or not. I use meta.running_is_success to deal with non-frequent topics.

I checked the subscribers.Event does similar to intended case but it takes std_msgs.Empty. One way of it would be to make it more general.

What are your thoughts on this @stonier

Do you mean subscribers.EventToBlackboard which always returns SUCCESS?

That one actually looks like a bug to be honest. It should return SUCCESS only when a msg is received so as to be consistent.

Key thing here is to provide as much information in the return value so that the user of the behaviour can decide what he wants to do with it. The combination of RUNNING when no msg is received and SUCCESS does that. The user can choose to infer, or simply to cap it with a decorator like you have done if they wish to filter the return information.

If you are proposing a new behaviour, or additional arguments to current behaviours to achieve it instead of the decorator, then I'd be worried that our decorators are failing to be useful enough to do the job they are designed to do. That feedback I'm interested in.

A good design goal -> behaviours should be as few and as simple as possible with as much information as they can in the return value. Decorators are there to fill out the cartesian product of all desirable permutations arising from a sparse number of behaviours seeding that cartesian product.

** cartesian product of all desirable permutations arising from a sparse number of behaviours seeding that cartesian product.** math!