allow byte array to use int data#184
Conversation
Signed-off-by: Chen Lihui <lihui.chen@sony.com>
|
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 <lihui.chen@sony.com>
fujitatomoya
left a comment
There was a problem hiding this comment.
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.
| # Copyright 2022 Open Source Robotics Foundation, Inc. | |
| # Copyright 2022 Sony Group Corporation. |
| @{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.
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)")}@ |
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Signed-off-by: Chen Lihui <lihui.chen@sony.com>
|
@sloretz can you take a look? |
clalancette
left a comment
There was a problem hiding this comment.
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? |
|
@sloretz friendly ping. |
|
@sloretz any chance this can go in? I just hit this issue |
|
Pulls: #184 |
to fix ros2/ros2cli#760
Signed-off-by: Chen Lihui lihui.chen@sony.com