Make rclpy.spin*() use a persistent executor#176
Merged
Conversation
mikaelarguedas
previously approved these changes
Mar 26, 2018
Member
mikaelarguedas
left a comment
There was a problem hiding this comment.
lgtm, with reran CI since it's been a while
b7d61f9 to
2de8cb7
Compare
Contributor
Author
|
New CI FYI @mikaelarguedas I rebased with master. It means |
Member
|
@mikaelarguedas PTAL |
rclpy/rclpy/__init__.py
Outdated
| if the global executor has a partially completed coroutine. | ||
|
|
||
| :param node: A node to add to the executor to check for work. | ||
| :param timeout_sec: Maximum time in seconds to wait for work. |
Member
There was a problem hiding this comment.
Is this blocking forever if negative timeout provided? Is the default behavior to wait forever as well? (I guess it's yes in both questions, but it may be worth mentioning it in the docblock
Contributor
Author
There was a problem hiding this comment.
Yup. I copy/pasted the timeout_sec documentation from executor.spin_once() in 93e42b5
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a bug where coroutine callbacks that yield while being handled in
rclpy.spin_once()never get executed again. The task is stored in the executor, but the executor is thrown away after spinning.This PR makes the global methods reuse an executor. The test checks that a task which yields during
rclpy.spin_once()gets resumed on a second invocation.CI
rcl.TestGetNodeNames__rmw_fastrtps_cpp.test_rcl_get_node_names--parallel