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

Revision history [back]

You are trying to acces the MultiArray directly over the [] operator. Check the message definition here.

You need to do a

vec.data[i++] = temp;

as, the data field is actually the vector representation. Also, make sure that the vector is big enough, so you don't get an index error. Use either the respective resize function or do push_back the new values.