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

Update topic_tools relay_field to Python 3 #2253

Open
wants to merge 2 commits into
base: noetic-devel
Choose a base branch
from

Conversation

RyanDMott
Copy link

Solves

Issue 2167

Content

Implementing the "unicode" to "bytes" migration the author of Issue 2167 describes.

After this change, Python's 2to3 only suggests

  • using list() to encase the result of a dictionary's items() before iterating over it (which is not useful) and
  • deleting the import of print_function from future (which we might as well do).

Explanation

To address the second half of issue #2167, it is the OP's example which is at fault, not relay_field. The example attempts to write a string to a field ("data") whose type has changed from "unicode" to "bytes" in Noetic. Replacing the empty string with empty brackets [] fixes that example. The example in the file's help looks intact.

Testing

On my copy of Noetic the attached example launch files run when the edit in this PR is made. Both show the frame_id being transferred but the timestamp changed to one second.

test_relay_field.tar.gz

I have not tested beyond these two examples.

@RyanDMott RyanDMott marked this pull request as ready for review June 27, 2022 22:47
Copy link
Contributor

@peci1 peci1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but a test would help here. I think starting by copying relay.test and changing it to relay a field would be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants