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

Revision history [back]

click to hide/show revision 1
initial version

In roscpp, messages natively support a field that is a single-dimension array. The c++ class for this ros message will implement the field using a std::vector<t>() object. Do a web search to learn how to store objects in a std::vector.

The class in your example, std_msgs::UInt8MultiArray() is a little odd. It was created in order to fake a multiple-dimension array using an array with only a single dimension.

See http://wiki.ros.org/Messages and http://wiki.ros.org/msg for more information about the field types in a ros message.