image_transport vs nodelets
Hello,
After reading the imagetransport documentation, it seems like you can subscribe to an imageraw stream, but the callback has a signature that receives const image pointers.
My current understanding is that if you want to pass pointers between nodes, they have to be nodelets living in the same nodelet manager, and sharing memory.
However, it now seems to me like i can have two nodes, both of which are using imagetransport, one is publishing a sensormsgs::ImagePtr, and the other subscribes to that topic and has the callback signature: imageCallback(const sensormsgs::ImageConstPtr& imgmsg).
Does this mean that the two nodes are communicating via pointers, and therefore the overhead of serializing and de-serializing large data (images), is avoided? OR, do i need to have those nodes as nodelets to acheive this purpose?
Asked by JadTawil on 2019-02-05 13:29:36 UTC
Answers
The pointers here are simply the way the image is passed to your callback. The pointers in the two nodes refer to different areas of memory and the image data will still need to copied on the way to the subscribing node.
Asked by PeteBlackerThe3rd on 2019-02-05 16:09:06 UTC
Comments
Okay, thanks i thought for a second it was only pointers being published over the wire..
Asked by JadTawil on 2019-02-05 17:21:35 UTC
Comments