I am considering setting up a ROS2 system which uses Yolo. I'd like the image sharing between the camera driver and the Yolo node to use memory sharing instead of serializing/deserializing over ROS messages. My understanding is that ROS2 composition can achieve this but currently only works with C++ 'components'. My understanding is that existing Yolo packages use Python. Is there a way to use Yolo in C++, maybe using some kind of a C++ wrapper?
$\begingroup$
$\endgroup$
1
-
$\begingroup$ Your question about shared memory seems like a textbook definition of premature optimization, but you haven't given us enough detail to be sure. It's also unclear to me how message serialization is involved. $\endgroup$– Mike973Commented Dec 9, 2023 at 14:00
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
You can use YOLO in DarkNet which is C and cuda. I have used it with ROS2 using the python API but the program compiled from source locally. I did not mix the DarkNet source code with ROS2 C++, just the API, but I suspect someone better at SW than me may be able to merge at source level. That may allow the memory based sharing you're asking about.
https://pjreddie.com/darknet/yolo/