Quick extraction of camera frames from GPU to other process

asked 2022-11-21 17:41:31 -0600


I am trying to extract frames at a high rate from multiple high res (about 2k*2k pixel) cameras at a time into RAM. I am using ogre2 engine, and gazebo fortress. The way I am currently doing it is to call ignition::rendering::Camera::Copy() for each camera consecutively after rendering each frame. This is too slow for my needs.

Initially I had hopes for ConnectNewImageFrame, but it does not appear to be implemented from looking at the source.

I have tried creating a thread per camera to call Copy() on, but this segfaults in Ogre::GL3PlusAsyncTextureTicket::createBuffer().

Then, I dug into the source, and found that gazebo is using Ogre::Image2::copyContentsToMemory() for this operation. Looking at the source of that, it appears that there is an async API to download data from GPU into RAM. If I could access this API, my frame downloading could be parallelized.

Is there a way to do this with the current Gazebo API?

If not, why not? what would be the best way to achieve my goal stated at the start of this question?

edit retag flag offensive close merge delete