Access to the gzclient_camera in a world plugin
Hi,
I'm trying to take a picture from a world that I create using a worldPlugin. For practical reasons, I'd like to take the picture at the end of the world plugin.
I noticed that when a gzclient is open, a camera "gzclient_camera" is created. I was hoping to select this camera from the world plugin and then take my picture by doing :
parent->GetByName("gzclient_camera")->SetPose(anIgnitionPose);
parent->GetByName("gzclient_camera")->SaveFrame(imgName);
With parent the WorldPtr to my world.
But it seems that it doesn't work. I was wondering if there is a way to select the gzclient_camera from the worldPtr. The API seems to say that "The world provides access to all other object within a simulated environment" but at the same time PrintEntityTree shows only models and the sun.
Thanks for anyone that can help.
PS : I guess it's possible to solve it by creating a sensor plugin and to calling it from the worldPlugin but it seems a little bit over complicated for probably 2 lines of code.