ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The data
fields of pixel
, nord
, and est
are all std::vector
, and must therefore have array elements allocated with either .resize()
(see this) or by using .push_back()
(see this).
Both ways will require your code to know how many array elements to expect in the input arguments to the send_immagine
function. If you know there are N
elements in the input arrays, you could use .resize(N)
on each data
field to allocate the required number of array elements, then copy each input array element into the corresponding vector element.
Alternatively, loop over the input array and call .push_back()
once for each element.