Gazebo | Ignition | Community
Ask Your Question

Why can I access Ogre ONLY in the SystemPlugin?

asked 2015-07-30 09:50:50 -0500

Zheng yo chen gravatar image

updated 2015-08-04 11:44:30 -0500

Can I access Ogre::SceneManager through cameraplugin?

I do know I can draw some MovableObject in system plugin.


So , I think if I got sceneManager,I could attach any MovableObject to rootSceneNode. In Camera plugin, I can get sceneManager by these code

ogre_camera = camera_sensor->GetCamera()->GetOgreCamera();
scene_mgr = ogre_camera->getSceneManager();

But , it turned out nothing happened. Why?

any advice is useful for newbie, Thank you :)


I have tried VisualPlugin,CameraPlugin,SystemPlugin,ModelPlugin,WorldPlugin.

I tried to get RenderEngine by the following code


And ,all the Plugins mentioned above did print:


So, I thought that I got RenderingEngine successfully. Next,I wanted to attach a ninja mesh to rootSceneNode in order to check if I can access OGRE.

Ogre::ResourceGroupManager *resource_group_mgr = Ogre::ResourceGroupManager::getSingletonPtr();
resource_group_mgr->addResourceLocation("/usr/local/ogre/ogre-1.9.0/share/OGRE/Media/models","FileSystem",Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,false );
////////check resource list////////////////////////////////////////////////////
Ogre::FileInfoListPtr fileinfoiter= Ogre::ResourceGroupManager::getSingleton().listResourceFileInfo(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) ;
for(unsigned int i=0;i<(*fileinfoiter).size();i++)

until this step ,every thing went well. When I added these two line:


It turned out that ONLY SystemPlugin can successfully show a ninja mesh,and except for SystemPlugin ,other Plugins just shut down whithout any error masseage

What am I doing wrong? What steps did I miss? Or would it be possible that GAZEBO was designed to access OGRE from SystemPlugin only?

Thank you

edit retag flag offensive close merge delete


If you didn't get any segfaults it means you have access to the scene manager. You can also take a look at a VisualPlugin if you don't want to use the cameraplugin.

AndreiHaidu gravatar imageAndreiHaidu ( 2015-07-31 04:12:08 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-08-12 22:08:13 -0500

Zheng yo chen gravatar image

there is a alternative way to access Ogre.

I inherit a "rendering::visual" class,and override "Load()" function. In "Load()" function ,I can new a ManualObject and attach it to childSceneNode.

This really works. Now I can draw what I want instead of using SystemPlugin.

edit flag offensive delete link more

answered 2015-08-05 06:19:38 -0500

The server itself does not need Ogre. Ogre is only used on client side for rendering(cause that is what OGRE does). All other components run in another application(gzserver instead of gzclient) so it is not possible to access the renderer from there.

edit flag offensive delete link more


ok thank you!

Zheng yo chen gravatar imageZheng yo chen ( 2015-08-06 00:30:03 -0500 )edit

i managed to access ogre via rendering::Visual

Zheng yo chen gravatar imageZheng yo chen ( 2015-08-12 22:10:12 -0500 )edit

Question Tools


Asked: 2015-07-30 09:50:50 -0500

Seen: 523 times

Last updated: Aug 12 '15