Ask Your Question
0

image_transport vs nodelets

asked 2019-02-05 12:29:36 -0500

JadTawil gravatar image

Hello,

After reading the image_transport documentation, it seems like you can subscribe to an image_raw 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 image_transport, one is publishing a sensor_msgs::ImagePtr, and the other subscribes to that topic and has the callback signature: imageCallback(const sensor_msgs::ImageConstPtr& img_msg).

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-02-05 15:09:06 -0500

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.

edit flag offensive delete link more

Comments

Okay, thanks i thought for a second it was only pointers being published over the wire..

JadTawil gravatar imageJadTawil ( 2019-02-05 16:21:35 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-02-05 12:29:36 -0500

Seen: 35 times

Last updated: Feb 05