Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Loaned messages for permanent (re)use and continous publishing

Hello !

Problem setup:

I have a camera (ROS2 EE, C++) node and another node processing the camera image. The camera driver (handled by the first node) is able to receive a memory pointer - at configuration time - where it will put last N captured images (ringbuffer configuration). I'd like to send this buffer as a (iceoryx) loaned message with zero copy to the other node for further processing, without always loaning and releasing a distinct message for every frame.

So what I'd like to do is the following:

1.) Define a custom fixed size message for image frame 2.) Borrow a loaned message from ixeoryx that is able to contain N of this custom message 3.) Pass the memory pointer of the loaned message data field to the camera driver at initialisation time. 4.) Start capturing 5.) While capturing, after each frame publish this loaned message to the other node (without releasing it, so the camera remains able to use it)

This was we were able to save 2 memory copy for each frame.

In the examples I haven't found any pattern how to do this. The "fixed_size_image_demo" borrows and releases a loaned message at every frame and uses memcpy to put data into that memory area - which I'm not sure is efficient.

Is it possible to do what I'd like ? thanks for any help or pointer, Cheers, gdebrecz

Loaned messages for permanent (re)use and continous publishing

Hello !

Problem setup:

I have a camera (ROS2 EE, C++) node and another node processing the camera image. The camera driver (handled by the first node) is able to receive a memory pointer - at configuration time - where it will put / store the last N captured images (ringbuffer image frame (in ring-buffer configuration). I'd like to send this buffer as a (iceoryx) loaned message with zero copy to the other node for further processing, without always loaning and releasing a distinct message for every frame.

So what I'd like to do is the following:

1.) Define a custom fixed size message for image frame 2.) Borrow a loaned message from ixeoryx that is able to contain N of this custom message 3.) Pass the memory pointer of the loaned message data field to the camera driver at initialisation time. 4.) Start capturing 5.) While capturing, after each frame publish this loaned message to the other node (without releasing it, so the camera remains able to use it)

This was we were able to save 2 memory copy for each frame.

In the examples I haven't found any pattern how to do this. The "fixed_size_image_demo" borrows and releases a loaned message at every frame and uses memcpy to put data into that memory area - which I'm not sure is efficient.

Is it possible to do what I'd like ? thanks for any help or pointer, Cheers, gdebrecz