How do I send an array of int16's using rosserial

asked 2017-04-24 18:25:36 -0500

Bob H gravatar image

I am trying to use the std_msgs, and can' figure out how to send an array of int16.
i have set std_msgs::Int16 head; I then try to assign the array to head head.data=array; that doesn't work

I have tried std_msgs::Int16 head[22]; that doesn't work

How does one set up an array of integers as a message in ROS? I have looked in the documentation and can't find anything. Can someone please help me.

edit retag flag offensive close merge delete

Comments

Please post your complete code, not just a couple of lines here and there.

Geoff gravatar image Geoff  ( 2017-04-24 21:41:43 -0500 )edit

Please provide more information. What do you mean "it doesn't work" ?. Does it compile? Does it communicate? Does it receive empty arrays?

Check out this question: http://answers.ros.org/question/22962...

vmatos gravatar image vmatos  ( 2017-04-25 09:35:43 -0500 )edit