ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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.