Revision: 7440
http://playerstage.svn.sourceforge.net/playerstage/?rev=7440&view=rev
Author: gerkey
Date: 2009-03-10 08:35:43 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
added check for model creation
Modified Paths:
--------------
code/branches/federation/gazebo/webgazebo/WebGazebo.cc
Modified: code/branches/federation/gazebo/webgazebo/WebGazebo.cc
===================================================================
--- code/branches/federation/gazebo/webgazebo/WebGazebo.cc 2009-03-10
08:29:24 UTC (rev 7439)
+++ code/branches/federation/gazebo/webgazebo/WebGazebo.cc 2009-03-10
08:35:43 UTC (rev 7440)
@@ -237,6 +237,23 @@
{
strcpy((char*)this->factoryIface->data->newModel, xmldata.c_str());
factoryIface->Unlock();
+
+ // Now, wait until Gazebo has consumed the new model
+ for(;;)
+ {
+ this->factoryIface->Lock(1);
+ if(!strcmp((const char*)this->factoryIface->data->newModel,""))
+ {
+ factoryIface->Unlock();
+ break;
+ }
+ else
+ {
+ factoryIface->Unlock();
+ nanosleep(&sleeptime, NULL);
+ }
+ }
+
response = std::string("Created model ") + name + " of type " + type;
return true;
}
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