robotology / gz-sim-yarp-plugins

YARP plugins for Modern Gazebo (gz-sim).
BSD 3-Clause "New" or "Revised" License
9 stars 2 forks source link

camera: Cleanup memory handling of CameraData #187

Closed traversaro closed 3 months ago

traversaro commented 3 months ago

I was starting to look into the Camera plugin to understand a bit of segfaults, and I noticed that the handling of data in CameraData was a bit complex. In particular, the only used CameraData instance was a local variable of the gzyarp::Camera gz-sim plugin, that then is passed via the setCameraData function to gzyarp::CameraDriver YARP device, where the m_imageBuffer buffer was allocated. To simplify everything, I just moved all the initialization to a init method of CameraData, and I called init in the method of gzyarp::Camera gz-sim plugin.

xela-95 commented 3 months ago

Rebased on main

xela-95 commented 3 months ago

Merging 🚀