ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Assuming your other data types match, data
is a vector, so you can't simply set it using =. Which explains your 'overloaded =' error. Why your memcpy didn't work is difficult to say without actual code; it should look something like:
memcpy(leftImage.data.data(),
pFrameData->leftData,
sizeof(uint8_t)*pFrameData->height*pFrameData->width)
I may have overlooked some details, this being off the top of my head (e.g., I think you need to cast the 1st and 2nd parameters to void*
).
2 | No.2 Revision |
Assuming your other data types match, data
is a vector, so you can't simply set it using =. Which explains your 'overloaded =' error. Why your memcpy didn't work is difficult to say without actual code; it should look something like:
memcpy(leftImage.data.data(),
pFrameData->leftData,
sizeof(uint8_t)*pFrameData->height*pFrameData->width)
I may have overlooked some details, this being off the top of my head (e.g., I think you need to cast the 1st and 2nd parameters to void*
).
And, after seeing @ahendrix's answer, I realize I forgot to reserve space before the memcpy. D'oh!