The ROS msg IDL only supports 1D arrays. The reshape approach is the correct approach to ensure compatibility in multiple languages.<br> <br> - Ken<br><br><div class="gmail_quote">On Mon, Jun 14, 2010 at 3:23 PM, Floris van Breugel <span dir="ltr"><<a href="mailto:florisvb@gmail.com">florisvb@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi folks,<br><br>Is there a way to publish 2D numpy arrays as messages (using python)? I went through the numpy tutorial for rospy but it seems to only work for 1D arrays. I suppose one could reshape the 2D array to be 1D, and pass the shape as another message, and then reconstruct it on the other side, but maybe there's a more efficient way to do it? Or that functionality could be added to numpy_msg.py? <br>


<a href="http://www.ros.org/wiki/rospy_tutorials/Tutorials/numpy" target="_blank">http://www.ros.org/wiki/rospy_tutorials/Tutorials/numpy</a><br clear="all"><br>Thanks!<br><br>- Floris<br><br><br><br>-- <br>Floris van Breugel<br>

Caltech Graduate Student<br>
Control and Dynamical Systems<br>(925) 963 8280<br><br>Wildlife and Landscape Photographer<br>Galleries: <a href="http://www.ArtInNaturePhotography.com/" target="_blank">http://www.ArtInNaturePhotography.com/</a><br>Blog: <a href="http://www.ArtInNaturePhotography.com/wordpress/" target="_blank">http://www.ArtInNaturePhotography.com/wordpress/</a><br>


2010 CALENDARS! Now available on my website!<br><br>
<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br>