-
Notifications
You must be signed in to change notification settings - Fork 350
Use wait_for_service #185
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
Use wait_for_service #185
Conversation
| # wait for connection to be established | ||
| # (no wait for service in Python yet) | ||
| time.sleep(1) | ||
| cli.wait_for_service() |
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.
Now that I've approved it 😄, I noticed that this will block forever. If you look at the C++ version it will do wait_for_service for say a second, then loop with a message like "still waiting for service..."
Not required, just an idea to exercise the timeout and return value.
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.
021f949 to
8ee5ca3
Compare
|
Rebased onto master. I think this can be merged now that ros2/rclpy#161 has been merged. I'll merge it before the end of the day to give time for objections. |
mikaelarguedas
left a comment
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.
lgtm
I'll leave @dhood the opportunity to comment as I don't know if there is pending work to convert these to use the loggers rather than printing to console like it's been done for the demos
dhood
left a comment
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.
logging can be updated in another pass, it will touch other lines/files
Replace sleep calls with calls to wait_for_service(). Labeled in-progress because it requires ros2/rclpy#127 to be merged first.