-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Remove service nodes in lifecycle_manager #2267
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
Changes from 5 commits
3f6ded4
921ec0c
cbed614
a37a6ac
597df82
366c2cb
1f9706e
ddf48e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,8 +125,9 @@ class ServiceClient | |
| /** | ||
| * @brief Block until a service is available | ||
| * @param timeout Maximum timeout to wait for, default infinite | ||
| * @return true if the client is ready | ||
| */ | ||
| void wait_for_service(const std::chrono::nanoseconds timeout = std::chrono::nanoseconds::max()) | ||
| bool wait_for_service(const std::chrono::nanoseconds timeout = std::chrono::nanoseconds::max()) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why a bool? It throws an exception if its not ready, there's no need to return the bool if success/failed because you'll know if an exception wasn't thrown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The exception is thrown only if rclcpp is not ok.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be sufficient?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an infinite while loop, this will never return a non-successful state because it will block forever or throw an exception in a failure state. |
||
| { | ||
| auto sleep_dur = std::chrono::milliseconds(10); | ||
| while (!client_->wait_for_service(timeout)) { | ||
|
|
@@ -136,6 +137,7 @@ class ServiceClient | |
| } | ||
| rclcpp::sleep_for(sleep_dur); | ||
| } | ||
| return !client_->service_is_ready(); | ||
| } | ||
|
|
||
| protected: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.