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

BT Action Node initialization does not timeout #3027

Closed
vinnnyr opened this issue Jun 21, 2022 · 2 comments
Closed

BT Action Node initialization does not timeout #3027

vinnnyr opened this issue Jun 21, 2022 · 2 comments

Comments

@vinnnyr
Copy link
Contributor

vinnnyr commented Jun 21, 2022

Feature request

Feature description

Add timeout to action client initialization in a BT action client node.

https://github.com/ros-planning/navigation2/blob/08e558fd5a7205142935190ce26d196b8c828911/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp#L93

Currently this wait_for_action_server call does not have a timeout. If the given action server is not healthy, or we are having other RMW/DDS issues, whatever component of the system that initializes the plugin / BT will just get stuck here.

Implementation considerations

Instead, I propose that we use the server_timeout parameter to have a timeout for the wait_for_action_server and throw an exception if the timeout has been violated so that the upper level system can handle the error / inform the user, or other parts of the system rather than hang out waiting for the action server indefinitely.

I believe it should be as simple as

auto was_successful = action_client_->wait_for_action_server(server_timeout_)
if (!was_successful) {
  throw std::runtime_error("Server Timeout exceeded");
@vinnnyr
Copy link
Contributor Author

vinnnyr commented Jun 21, 2022

PR is incoming. Just testing to make sure it solves my problem

@SteveMacenski
Copy link
Member

Merged

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

No branches or pull requests

2 participants