-
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
Increase BT action node's action server timeout #3259
Conversation
@tonynajjar, please properly fill in PR template in the future. @SteveMacenski, use this instead.
|
Codecov ReportBase: 82.24% // Head: 82.10% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #3259 +/- ##
==========================================
- Coverage 82.24% 82.10% -0.15%
==========================================
Files 341 341
Lines 15537 15537
==========================================
- Hits 12779 12756 -23
- Misses 2758 2781 +23
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I assume you are seeing this behavior in a custom launch file? I am not able to reproduce with the default launch files. You would also have to extend this timeout for the other Bt base classes. (service, cancel ....). I think the best approach is to pull this out into a parameter and allow the user to set the max wait time. |
This shouldn’t be an issue when using lifecycle nodes. the lifecycle manager only brings up constituent nodes after the previous others are already initialized. Maybe you just need to select a more reasonable order for node initialization of the navigation system? The order of nodes in the launch file given to the lifecycle manager is not arbitrary. It is ordered so that the last things are dependent on the previous so it doesn’t come up until they’re already so. Please explain 🙂 |
any update? |
not yet but not forgotten! I'm busy migrating the whole system to Humble and this was one small hickup we had. I'll update once I get back to it |
yes custom launch files, I should have mentioned that
I see what you mean and I think I see the issue now. I have custom BT Action nodes as well as custom behaviors/action servers. These action servers are launched non-deterministically in the launch file; they are python nodes so unfortunately I can't use lifecycle nodes. Do you have other recommendations for my case other than increasing the timeout? |
Can't you? https://github.com/ros2/rclpy/tree/rolling/rclpy/rclpy/lifecycle they appear to be in Humble and Rolling. Demo: https://github.com/ros2/demos/tree/humble/lifecycle_py But otherwise, I believe that Launch is deterministic in execution order provided, so you can bring up all the servers in the launch file first before the BT navigator. Maybe that'll be enough? Hackier: use the launch prefix field to basically ask for a sleep as this answer points out: https://answers.ros.org/question/233353/set-delay-between-starting-nodes-within-launch-file/ for the BT navigator node to give the other nodes times to initialize. Better yet: https://www.reddit.com/r/ROS/comments/qxbi3z/ros2_is_it_possible_to_have_something_delayed_at/ there's a timed delay action launch node it appears. Best: use the rclpy lifecycle nodes |
Oh I thought these would never see the light, thanks for the info. But it's too much work for the moment
really? But even then I don't think launching the action servers a couple of seconds earlier would fix the issue
Yes I know about this one, it could work I still think increasing the timeout would be the easiest/quickest solution, do you see any drawbacks to it (apart from users having to wait a bit longer to see an error message) |
😢
That's a long delay to fail and would give users a bad user-experience if they launched BTs with task servers legit just not existing. Waiting 10 seconds to throw and then fail the navigation task is not very "reactive". As a user of this, I'd be pretty frustrated to have to wait 10 seconds to be told of a trivial typo error while prototyping. |
Alright then, if there is no solution to contribute here, feel free to close the PR. Thanks for the alternatives, will look into them more. |
OK - sorry for not being able to get this one in. But I think there are some optimal (lifecycle py) options and sketchier but suitable solutions (timed action) at launch time. |
Basic Info
Description of contribution in a few bullet points
Sometimes the BT nodes are launched before the action servers (as part of a launch file) causing the BT nodes initialization to fail, so I increased the timeout from 1 to 10 seconds
For Maintainers: