ros / ros_comm

ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).
http://wiki.ros.org/ros_comm
752 stars 911 forks source link

Update topic_tools relay_field to Python 3 #2253

Open RyanDMott opened 2 years ago

RyanDMott commented 2 years ago

Solves

Issue 2167

Content

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

After this change, Python's 2to3 only suggests

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.