-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
The first-time failure in the IsBatteryLow condition check #4802
Comments
What is your suggested solution? This seems like a reasonable choice to me and the design pattern we do in multiple BT nodes. I can see how it takes some time to 'warm up' to get the first message since its just starting, but I don't know how actionable a change would be. If your application is sensitive to that, you could use a service call instead of a topic to obtain the battery information or possibly tick and have a delay action node to tick again to wait for a message on startup. There are probably other solutions too. If this is being performed in a reactive control flow node, then it'll trigger on soon after the first message is actually received, the delay should be negligible proportional to the publication rate of your battery state information. I'm definitely open for suggestions :-) |
Constructing a behavior tree while considering whether the nodes will function correctly on the first run can easily become a source of bugs and make the behavior tree itself difficult to read. Even if sufficient time is allocated for warmup, subscribers won't be created unless the nodes are executed at least once. Therefore, ensuring sufficient time between launching the node and triggering the behavior tree execution is completely ineffective. How about calling |
Some thoughts before responding to your items: I'm noticing that the BT Action Nodes and BT Service Nodes construct their service/action clients in the constructor of those nodes. These are special cases since the action names are set by the BT node name. We could very easily just create all ROS interfaces for BT nodes (like So, we could create the ROS interfaces, with the current input port status, in the constructor and also leave the creation in I think that would solve the issue and a pattern that could be repeated in all BT nodes that have internal ROS interfaces
We likely cannot, since they get parameters that need to be gotten in the tick due to problems discussed in #3988 -- this is actually how we used to handle it. Perhaps @maksymdidukh can also chime in his thoughts. But also see above.
We don't need to backport everywhere if we cannot, that could be a viable solution. Waiting for message would need to block for no more than the tick rate, the same way we do for services and actions that return the Though, waiting for a message for, lets say 250ms, every time we retick a tree would be blocking all other productive action frequently. I'm not sure exactly this is the best way.
This could just pedantic due to the nature of the |
Bug report
Required Info:
When performing the check with the
IsBatteryLow
condition for the first time, it almost always results inFAILURE
because a subscriber is created and thenspin_some()
is executed shortly thereafter.Steps to reproduce issue
Expected behavior
Actual behavior
Additional information
The text was updated successfully, but these errors were encountered: