Ask Your Question

ByteMultiArray publish fails if data > 10 bytes

asked 2017-11-27 12:32:47 -0500

fpgamcu gravatar image

updated 2017-11-27 14:02:26 -0500

gvdhoorn gravatar image

I have next code:

data =  
arr = ByteMultiArray() = list(bytearray(data))  
arr.layout.dim[0].label = "soundfile"  
arr.layout.dim[0].size = len(  
arr.layout.dim[0].stride = len(  
arr.layout.data_offset = 0  

When data 10 and less publish succeed When data > 10 I have

rospy.exceptions.ROSSerializationException: field data[] exceeds specified width [byte]
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-11-29 06:03:16 -0500

At first glance the problem looks like the stride value you are giving it. The stride is the number of bytes for each element in the array in this case 1, it definitely shouldn't be the array length. Try setting the stride to 1 and see if that fixes the problem.

edit flag offensive delete link more


With stride = 1 still same error.

fpgamcu gravatar image fpgamcu  ( 2017-11-29 06:22:30 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-11-27 12:30:34 -0500

Seen: 188 times

Last updated: Nov 29 '17