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

rclpy_take_response checks sequence number #171

Merged
merged 2 commits into from
Jan 24, 2018

Conversation

sloretz
Copy link
Contributor

@sloretz sloretz commented Jan 8, 2018

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)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@sloretz sloretz added the in review Waiting for review (Kanban column) label Jan 8, 2018
@sloretz sloretz self-assigned this Jan 8, 2018
@@ -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(
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@sloretz sloretz added the bug Something isn't working label Jan 12, 2018
Fixes a bug where rclpy_take_response was ignoring the sequence number
returned by rcl_take_response in the struct rmw_request_id_t.
@sloretz sloretz force-pushed the rclpy_take_response_get_sequence branch from 76a3d07 to e260ce6 Compare January 19, 2018 01:25
Copy link
Member

@mikaelarguedas mikaelarguedas left a 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);
Copy link
Member

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 👍

@sloretz sloretz merged commit 7180fdf into master Jan 24, 2018
@sloretz sloretz deleted the rclpy_take_response_get_sequence branch January 24, 2018 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in review Waiting for review (Kanban column)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants