ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Yep I think your approach is good enough. You define an one dimensional array in msg and after you receive the msg in your callback you restructure this as a 2D array. One thing I can recommend though is that you add 2 additional fields such as width and height to your msg description, and when you recive your msg you can know the correct dimensions by receiving width and height

A good use case will be to check how sensor_msgs::Image do this by something similar;