-
Notifications
You must be signed in to change notification settings - Fork 237
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
rclpy_take_response checks sequence number #171
Conversation
rclpy/rclpy/client.py
Outdated
@@ -44,12 +44,11 @@ def run(self): | |||
if sigint_gc_handle in guard_condition_ready_list: | |||
rclpy.utilities.shutdown() | |||
return | |||
response = _rclpy.rclpy_take_response( | |||
seq_and_response = _rclpy.rclpy_take_response( |
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.
Could we use something lilke [seq, response] = _rclpy.rclpy_take_response(...
for readability?
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.
Sure. It just means making rclpy_take_response return (None, None)
on when there is nothing to take instead of None.
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.
Changed in 76a3d07
CI is running.
Fixes a bug where rclpy_take_response was ignoring the sequence number returned by rcl_take_response in the struct rmw_request_id_t.
76a3d07
to
e260ce6
Compare
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 thanks @sloretz for iterating
PyTuple_SET_ITEM(pytuple, 1, pytaken_response); | ||
return pytuple; | ||
} | ||
Py_INCREF(Py_None); |
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.
I was surprised that Py_None needed to be incref'ed but apparently that's necessary 👍
This fixes a bug where rclpy_take_response ignores the sequence number in a struct populated by rcl_take_response. This becomes important once the client supports multiple outstanding requests (#170).
connects to ros2/rcl#205
CI (with e260ce6)