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.
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 usedCameraData
instance was a local variable of thegzyarp::Camera
gz-sim plugin, that then is passed via thesetCameraData
function togzyarp::CameraDriver
YARP device, where them_imageBuffer
buffer was allocated. To simplify everything, I just moved all the initialization to ainit
method ofCameraData
, and I calledinit
in the method ofgzyarp::Camera
gz-sim plugin.