Revision: 7903
http://playerstage.svn.sourceforge.net/playerstage/?rev=7903&view=rev
Author: natepak
Date: 2009-06-25 15:59:17 +0000 (Thu, 25 Jun 2009)
Log Message:
-----------
Moved the GraphicsIfaceHandler update to the mainloop
Modified Paths:
--------------
code/gazebo/trunk/examples/libgazebo/graphics3d/graphics3d.cc
code/gazebo/trunk/server/Model.cc
code/gazebo/trunk/server/Model.hh
code/gazebo/trunk/server/Simulator.cc
code/gazebo/trunk/server/World.cc
code/gazebo/trunk/server/World.hh
Modified: code/gazebo/trunk/examples/libgazebo/graphics3d/graphics3d.cc
===================================================================
--- code/gazebo/trunk/examples/libgazebo/graphics3d/graphics3d.cc
2009-06-25 15:43:44 UTC (rev 7902)
+++ code/gazebo/trunk/examples/libgazebo/graphics3d/graphics3d.cc
2009-06-25 15:59:17 UTC (rev 7903)
@@ -199,7 +199,7 @@
simIface->Open(client, "default");
g3dIface->Open(client, "default");
- posIface->Open(client, "position_iface_0");
+ posIface->Open(client, "pioneer2dx_model1::position_iface_0");
pioneerG3DIface->Open(client,"pioneer2dx_model1");
}
catch (std::string e)
Modified: code/gazebo/trunk/server/Model.cc
===================================================================
--- code/gazebo/trunk/server/Model.cc 2009-06-25 15:43:44 UTC (rev 7902)
+++ code/gazebo/trunk/server/Model.cc 2009-06-25 15:59:17 UTC (rev 7903)
@@ -464,12 +464,6 @@
this->xyzP->SetValue(this->pose.pos);
this->rpyP->SetValue(this->pose.rot);
}
-
- if (this->graphicsHandler)
- {
- this->graphicsHandler->Update();
- }
-
#ifdef TIMING
this->UpdateChild();
@@ -482,13 +476,20 @@
this->UpdateChild();
#endif
+}
+////////////////////////////////////////////////////////////////////////////////
+/// Primarily used to update the graphics interfaces
+void Model::GraphicsUpdate()
+{
+ if (this->graphicsHandler)
+ {
+ this->graphicsHandler->Update();
+ }
+}
- this->UpdateChild();
-}
-
////////////////////////////////////////////////////////////////////////////////
// Finalize the model
void Model::Fini()
Modified: code/gazebo/trunk/server/Model.hh
===================================================================
--- code/gazebo/trunk/server/Model.hh 2009-06-25 15:43:44 UTC (rev 7902)
+++ code/gazebo/trunk/server/Model.hh 2009-06-25 15:59:17 UTC (rev 7903)
@@ -82,7 +82,10 @@
/// \brief Update the model
/// \param params Update parameters
public: void Update();
-
+
+ /// \brief Primarily used to update the graphics interfaces
+ public: void GraphicsUpdate();
+
/// \brief Finalize the model
public: void Fini();
Modified: code/gazebo/trunk/server/Simulator.cc
===================================================================
--- code/gazebo/trunk/server/Simulator.cc 2009-06-25 15:43:44 UTC (rev
7902)
+++ code/gazebo/trunk/server/Simulator.cc 2009-06-25 15:59:17 UTC (rev
7903)
@@ -360,6 +360,7 @@
}
World::Instance()->ProcessEntitiesToLoad();
+ World::Instance()->GraphicsUpdate();
currTime = this->GetWallTime();
Modified: code/gazebo/trunk/server/World.cc
===================================================================
--- code/gazebo/trunk/server/World.cc 2009-06-25 15:43:44 UTC (rev 7902)
+++ code/gazebo/trunk/server/World.cc 2009-06-25 15:59:17 UTC (rev 7903)
@@ -216,6 +216,21 @@
}
////////////////////////////////////////////////////////////////////////////////
+// Primarily used to update the graphics interfaces
+void World::GraphicsUpdate()
+{
+ // Update all the models
+ std::vector< Model* >::iterator miter;
+ for (miter=this->models.begin(); miter!=this->models.end(); miter++)
+ {
+ if (*miter)
+ {
+ (*miter)->GraphicsUpdate();
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
// Update the world
void World::Update()
{
Modified: code/gazebo/trunk/server/World.hh
===================================================================
--- code/gazebo/trunk/server/World.hh 2009-06-25 15:43:44 UTC (rev 7902)
+++ code/gazebo/trunk/server/World.hh 2009-06-25 15:59:17 UTC (rev 7903)
@@ -82,6 +82,9 @@
/// Update the world
public: void Update();
+ /// \brief Primarily used to update the graphics interfaces
+ public: void GraphicsUpdate();
+
/// Finilize the world
public: void Fini();
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit