Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can I access Ogre::sceneManager through cameraplugin?

Can I access Ogre::sceneManager through cameraplugin?

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

mSceneMgr=rendering::get_scene()->GetVisual(0)->GetSceneNode()->getCreator();
rootSceneNode=mSceneMgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

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();
rootSceneNode=scene_mgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

But , it turned out nothing happened.

any advice is useful for newbie, Thank you :)

Can I access Ogre::sceneManager through cameraplugin?

Can I access Ogre::sceneManager through cameraplugin?

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

mSceneMgr=rendering::get_scene()->GetVisual(0)->GetSceneNode()->getCreator();
rootSceneNode=mSceneMgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

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();
rootSceneNode=scene_mgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

But , it turned out nothing happened.

any advice is useful for newbie, Thank you :)

Can I access Ogre::sceneManager through cameraplugin?

Can I access Ogre::sceneManager through cameraplugin?

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

mSceneMgr=rendering::get_scene()->GetVisual(0)->GetSceneNode()->getCreator();
rootSceneNode=mSceneMgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

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();
rootSceneNode=scene_mgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

But , it turned out nothing happened.happened. Why?

any advice is useful for newbie, Thank you :)

Can I access Ogre::sceneManager Ogre::SceneManager through cameraplugin?

Can I access Ogre::sceneManager Ogre::SceneManager through cameraplugin?

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

mSceneMgr=rendering::get_scene()->GetVisual(0)->GetSceneNode()->getCreator();
rootSceneNode=mSceneMgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

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();
rootSceneNode=scene_mgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

But , it turned out nothing happened. Why?

any advice is useful for newbie, Thank you :)

Can Why can I access Ogre::SceneManager through cameraplugin?Ogre ONLY in the SystemPlugin?

Can I access Ogre::SceneManager through cameraplugin?

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

mSceneMgr=rendering::get_scene()->GetVisual(0)->GetSceneNode()->getCreator();
rootSceneNode=mSceneMgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

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();
rootSceneNode=scene_mgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

But , it turned out nothing happened. Why?

any advice is useful for newbie, Thank you :)

UPDATE:

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

I tried to get RenderEngine by the following code

cout<<rendering::RenderEngine::GetInstance().GetScene()->GetName()<<endl;
cout<<rendering::RenderEngine::GetInstance().GetSceneCount()<<endl;

And ,all the Plugins mentioned above did print:

default
1

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 );
resource_group_mgr->initialiseResourceGroup(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
////////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++)
   cout<<(*fileinfoiter)[i].filename<<endl;

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

ent=mSceneMgr->createEntity("ninja.mesh");
rootSceneNode->createChildSceneNode("XDD")->attachObject(ent);

It turned out that ONLY SystemPlugin can successfully show a ninja mesh,and except SystemPlugin ,other Plugins crashed.orz

What am I doing wrong? What steps did I miss? Or would it be possible that GAZEBO was not designed to access OGRE other than SystemPlugin originally.

Why can I access Ogre ONLY in the SystemPlugin?

Can I access Ogre::SceneManager through cameraplugin?

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

mSceneMgr=rendering::get_scene()->GetVisual(0)->GetSceneNode()->getCreator();
rootSceneNode=mSceneMgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

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();
rootSceneNode=scene_mgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

But , it turned out nothing happened. Why?

any advice is useful for newbie, Thank you :)

UPDATE:

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

I tried to get RenderEngine by the following code

cout<<rendering::RenderEngine::GetInstance().GetScene()->GetName()<<endl;
cout<<rendering::RenderEngine::GetInstance().GetSceneCount()<<endl;

And ,all the Plugins mentioned above did print:

default
1

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 );
resource_group_mgr->initialiseResourceGroup(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
////////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++)
   cout<<(*fileinfoiter)[i].filename<<endl;

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

ent=mSceneMgr->createEntity("ninja.mesh");
rootSceneNode->createChildSceneNode("XDD")->attachObject(ent);

It turned out that ONLY SystemPlugin can successfully show a ninja mesh,and except SystemPlugin ,other Plugins crashed.orz

What am I doing wrong? What steps did I miss? Or would it be possible that GAZEBO was not designed to access OGRE other than SystemPlugin originally.

Why can I access Ogre ONLY in the SystemPlugin?

Can I access Ogre::SceneManager through cameraplugin?

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

mSceneMgr=rendering::get_scene()->GetVisual(0)->GetSceneNode()->getCreator();
rootSceneNode=mSceneMgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

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();
rootSceneNode=scene_mgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

But , it turned out nothing happened. Why?

any advice is useful for newbie, Thank you :)

UPDATE:

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

I tried to get RenderEngine by the following code

cout<<rendering::RenderEngine::GetInstance().GetScene()->GetName()<<endl;
cout<<rendering::RenderEngine::GetInstance().GetSceneCount()<<endl;

And ,all the Plugins mentioned above did print:

default
1

So, I thought that I got RenderingEngine successfully. Next,I wanted to attach a ninja.mesh 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 );
resource_group_mgr->initialiseResourceGroup(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
////////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++)
   cout<<(*fileinfoiter)[i].filename<<endl;

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

ent=mSceneMgr->createEntity("ninja.mesh");
rootSceneNode->createChildSceneNode("XDD")->attachObject(ent);
rootSceneNode->createChildSceneNode("ninja")->attachObject(ent);

It turned out that ONLY SystemPlugin can successfully show a ninja mesh,and except SystemPlugin ,other Plugins crashed.orz

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

Why can I access Ogre ONLY in the SystemPlugin?

Can I access Ogre::SceneManager through cameraplugin?

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

mSceneMgr=rendering::get_scene()->GetVisual(0)->GetSceneNode()->getCreator();
rootSceneNode=mSceneMgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

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();
rootSceneNode=scene_mgr->getRootSceneNode();
rootSceneNode->createChildSceneNode("trajectory_visual_line")->attachObject(line_object);

But , it turned out nothing happened. Why?

any advice is useful for newbie, Thank you :)

UPDATE:

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

I tried to get RenderEngine by the following code

cout<<rendering::RenderEngine::GetInstance().GetScene()->GetName()<<endl;
cout<<rendering::RenderEngine::GetInstance().GetSceneCount()<<endl;

And ,all the Plugins mentioned above did print:

default
1

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 );
resource_group_mgr->initialiseResourceGroup(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
////////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++)
   cout<<(*fileinfoiter)[i].filename<<endl;

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

ent=mSceneMgr->createEntity("ninja.mesh");
rootSceneNode->createChildSceneNode("ninja")->attachObject(ent);

It turned out that ONLY SystemPlugin can successfully show a ninja mesh,and except for SystemPlugin ,other Plugins crashed.orzjust 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