-
Notifications
You must be signed in to change notification settings - Fork 45
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
allow byte array to use int data #184
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: Chen Lihui <[email protected]>
Signed-off-by: Chen Lihui <[email protected]>
and use # console A
$ ros2 topic pub -1 /whatever std_msgs/msg/ByteMultiArray "{data: [1, 2, 3]}"
# console B
$ ros2 topic echo /whatever std_msgs/msg/ByteMultiArray |
Signed-off-by: Chen Lihui <[email protected]>
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.
a couple of comments, but overall lgtm.
@@ -0,0 +1,73 @@ | |||
# Copyright 2022 Open Source Robotics Foundation, Inc. |
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.
# Copyright 2022 Open Source Robotics Foundation, Inc. | |
# Copyright 2022 Sony Group Corporation. |
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.
Updated in 2a61cfc
@{assert_msg_suffixes.append("and each value of type '%s'" % get_python_type(type_))}@ | ||
@[ if get_python_type(type_) == 'bytes']@ | ||
@{byte_array_detected = True}@ | ||
@{assert_msg_suffixes.append("or type 'int' in range(0, 256)")}@ |
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.
1 byte range should be 0 to 255?
@{assert_msg_suffixes.append("or type 'int' in range(0, 256)")}@ | |
@{assert_msg_suffixes.append("or type 'int' in range(0, 255)")}@ |
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.
Thank you.
Co-authored-by: Tomoya Fujita <[email protected]> Signed-off-by: Chen Lihui <[email protected]>
@sloretz can you take a look? |
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 don't love adding more work to the assert checking; this is already a very slow portion of Python, and this will make it worse. But it does allow this to proceed, so I'm reluctantly going to approve this.
@sloretz A final review by you would be appreciated here.
@iuhilnehc-ynos can you rebase and start CI for this? |
Signed-off-by: Chen Lihui <[email protected]>
@sloretz friendly ping. |
@sloretz any chance this can go in? I just hit this issue |
to fix ros2/ros2cli#760
Signed-off-by: Chen Lihui [email protected]