From: <na...@us...> - 2008-09-24 18:13:02
|
Revision: 7044 http://playerstage.svn.sourceforge.net/playerstage/?rev=7044&view=rev Author: natepak Date: 2008-09-24 18:12:51 +0000 (Wed, 24 Sep 2008) Log Message: ----------- add svn properties Property Changed: ---------------- code/gazebo/trunk/libgazebo/ code/gazebo/trunk/libgazebo/Client.cc code/gazebo/trunk/libgazebo/Iface.cc code/gazebo/trunk/libgazebo/IfaceFactory.cc code/gazebo/trunk/libgazebo/IfaceFactory.hh code/gazebo/trunk/libgazebo/Server.cc code/gazebo/trunk/libgazebo/bindings/ code/gazebo/trunk/libgazebo/bindings/python/ code/gazebo/trunk/libgazebo/bindings/python/test/ code/gazebo/trunk/libgazebo/pygazebo/ Property changes on: code/gazebo/trunk/libgazebo ___________________________________________________________________ Modified: svn:ignore - *.os *.a *.so libgazebo.pc + .player *.os *.so *.o *.a config.log .scon* Ogre.log gazebo Doxyfile gazeborc *.pc .settings .cproject .project bandit Property changes on: code/gazebo/trunk/libgazebo/Client.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/libgazebo/Iface.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/libgazebo/IfaceFactory.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/libgazebo/IfaceFactory.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/libgazebo/Server.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/libgazebo/bindings ___________________________________________________________________ Added: svn:ignore + .player *.os *.so *.o *.a config.log .scon* Ogre.log gazebo Doxyfile gazeborc *.pc .settings .cproject .project bandit Property changes on: code/gazebo/trunk/libgazebo/bindings/python ___________________________________________________________________ Added: svn:ignore + .player *.os *.so *.o *.a config.log .scon* Ogre.log gazebo Doxyfile gazeborc *.pc .settings .cproject .project bandit Property changes on: code/gazebo/trunk/libgazebo/bindings/python/test ___________________________________________________________________ Added: svn:ignore + .player *.os *.so *.o *.a config.log .scon* Ogre.log gazebo Doxyfile gazeborc *.pc .settings .cproject .project bandit Property changes on: code/gazebo/trunk/libgazebo/pygazebo ___________________________________________________________________ Added: svn:ignore + .player *.os *.so *.o *.a config.log .scon* Ogre.log gazebo Doxyfile gazeborc *.pc .settings .cproject .project bandit This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2008-11-12 19:37:12
|
Revision: 7128 http://playerstage.svn.sourceforge.net/playerstage/?rev=7128&view=rev Author: natepak Date: 2008-11-12 19:37:09 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Added more/better debugging messages Modified Paths: -------------- code/gazebo/trunk/libgazebo/Client.cc code/gazebo/trunk/libgazebo/Server.cc Modified: code/gazebo/trunk/libgazebo/Client.cc =================================================================== --- code/gazebo/trunk/libgazebo/Client.cc 2008-11-07 16:41:20 UTC (rev 7127) +++ code/gazebo/trunk/libgazebo/Client.cc 2008-11-12 19:37:09 UTC (rev 7128) @@ -195,8 +195,9 @@ if (this->semId < 0) { std::ostringstream stream; - stream << "Failed to allocate semaphore [" << strerror(errno) << "]\n" - << "The server does not appear to be running"; + stream << "libgazebo client failed to allocate semaphore [" + << strerror(errno) << "]\n" << "The server does not appear to be running." + << "Make sure you have started gazebo before running a client program."; throw(stream.str()); } } Modified: code/gazebo/trunk/libgazebo/Server.cc =================================================================== --- code/gazebo/trunk/libgazebo/Server.cc 2008-11-07 16:41:20 UTC (rev 7127) +++ code/gazebo/trunk/libgazebo/Server.cc 2008-11-12 19:37:09 UTC (rev 7128) @@ -225,7 +225,7 @@ // Create semaphores for clients if (this->semId < 0) { - stream << "Failed to allocate semaphore [" << strerror(errno) << "]"; + stream << "libgazebo server failed to allocate semaphore [" << strerror(errno) << "]"; if (errno == EEXIST) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <as...@us...> - 2009-06-27 00:06:42
|
Revision: 7916 http://playerstage.svn.sourceforge.net/playerstage/?rev=7916&view=rev Author: asadat Date: 2009-06-27 00:06:41 +0000 (Sat, 27 Jun 2009) Log Message: ----------- added some functionality to simIface for getting interfaces and their types Modified Paths: -------------- code/gazebo/trunk/libgazebo/SimIface.cc code/gazebo/trunk/libgazebo/gazebo.h Modified: code/gazebo/trunk/libgazebo/SimIface.cc =================================================================== --- code/gazebo/trunk/libgazebo/SimIface.cc 2009-06-27 00:04:46 UTC (rev 7915) +++ code/gazebo/trunk/libgazebo/SimIface.cc 2009-06-27 00:06:41 UTC (rev 7916) @@ -276,8 +276,39 @@ this->Unlock(); } +////////////////////////////////////////////////////////////////////////////////// +/// Get then children of a model +void SimulationIface::GetChildInterfaces(const char *modelName) +{ -//////////////////////////////////////////////////////////////////////////////// + this->Lock(1); + SimulationRequestData *request = &(this->data->requests[this->data->requestCount++]); + + request->type = gazebo::SimulationRequestData::GET_MODEL_INTERFACES; + + memset(request->modelName, 0, 512); + strncpy(request->modelName, modelName, 512); + request->modelName[511] = '\0'; + + this->Unlock(); + +} +/////////////////////////////////////////////////////////////////////////////////// +/// \brief Get the Type of a model e.g. "laser" "model" "fiducial" +void SimulationIface::GetInterfaceType(const char *modelName) +{ + this->Lock(1); + SimulationRequestData *request = &(this->data->requests[this->data->requestCount++]); + + request->type = gazebo::SimulationRequestData::GET_INTERFACE_TYPE; + + memset(request->modelName, 0, 512); + strncpy(request->modelName, modelName, 512); + request->modelName[511] = '\0'; + + this->Unlock(); +} +/////////////////////////////////////////////////////////////////////////////// // Wait for a post on the go ack semaphore void SimulationIface::GoAckWait() { Modified: code/gazebo/trunk/libgazebo/gazebo.h =================================================================== --- code/gazebo/trunk/libgazebo/gazebo.h 2009-06-27 00:04:46 UTC (rev 7915) +++ code/gazebo/trunk/libgazebo/gazebo.h 2009-06-27 00:06:41 UTC (rev 7916) @@ -413,6 +413,7 @@ */ #define GAZEBO_SIMULATION_MAX_REQUESTS 128 +#define GAZEBO_MAX_NUMBER_OF_CHILDREN 256 class SimulationRequestData { @@ -426,12 +427,15 @@ SET_POSE2D, SET_STATE, GO, - GET_MODEL_TYPE, + GET_MODEL_TYPE, GET_NUM_MODELS, GET_NUM_CHILDREN, GET_CHILD_NAME, GET_MODEL_NAME, - GET_MODEL_EXTENT + GET_MODEL_EXTENT, + GET_MODEL_INTERFACES, // for getting interfaces as well as the models which are ancestors of interfaces + GET_INTERFACE_TYPE // if the model is not an interface 'unknown' is returned + }; public: Type type; @@ -446,6 +450,10 @@ public: Vec3 modelLinearAccel; public: Vec3 modelAngularAccel; public: unsigned int runTime; + public: char childInterfaces[GAZEBO_MAX_NUMBER_OF_CHILDREN][512]; + public: int nChildInterfaces; + //public: char modelType[512]; + }; /// \brief Simulation interface data @@ -548,6 +556,13 @@ const Vec3 &linearVel, const Vec3 &angularVel, const Vec3 &linearAccel, const Vec3 &angularAccel ); + + /// \brief Get the child interfaces of a model + public: void GetChildInterfaces(const char *modelName); + + /// \brief Get the Type of an interface e.g. "laser" "model" "fiducial" + public: void GetInterfaceType(const char *modelName); + /// \brief Get the type of this model public: bool GetModelType(const char *modelName, std::string &type); @@ -567,6 +582,7 @@ /// \brief Get the extents of a model public: bool GetModelExtent(const char *modelName, Vec3 &ext); + public: void GoAckWait(); public: void GoAckPost(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2009-07-11 02:18:10
|
Revision: 7989 http://playerstage.svn.sourceforge.net/playerstage/?rev=7989&view=rev Author: robotos Date: 2009-07-11 02:18:03 +0000 (Sat, 11 Jul 2009) Log Message: ----------- GetModelFiducialID to SimulationIface. Catch closing interfaces without opening them Modified Paths: -------------- code/gazebo/trunk/libgazebo/Client.cc code/gazebo/trunk/libgazebo/Iface.cc code/gazebo/trunk/libgazebo/SimIface.cc code/gazebo/trunk/libgazebo/gazebo.h Modified: code/gazebo/trunk/libgazebo/Client.cc =================================================================== --- code/gazebo/trunk/libgazebo/Client.cc 2009-07-11 01:08:17 UTC (rev 7988) +++ code/gazebo/trunk/libgazebo/Client.cc 2009-07-11 02:18:03 UTC (rev 7989) @@ -220,7 +220,7 @@ // No semaphore, so no server if (errno == ENOENT) { - throw("No semphaore, so no server"); + throw("No semaphore, so no server"); } // Ooops, some kind of error Modified: code/gazebo/trunk/libgazebo/Iface.cc =================================================================== --- code/gazebo/trunk/libgazebo/Iface.cc 2009-07-11 01:08:17 UTC (rev 7988) +++ code/gazebo/trunk/libgazebo/Iface.cc 2009-07-11 02:18:03 UTC (rev 7989) @@ -74,6 +74,8 @@ this->client = NULL; this->creator = false; + + this->mMap = NULL; } @@ -327,6 +329,11 @@ // Close the interface (client) void Iface::Close() { + if (this->mMap == 0) //Closing without opening! + { + throw("mmap file not opened. Closing interface without opening it first?"); + } + ((GazeboData*)this->mMap)->openCount--; if (((GazeboData*)this->mMap)->openCount <= 0) Modified: code/gazebo/trunk/libgazebo/SimIface.cc =================================================================== --- code/gazebo/trunk/libgazebo/SimIface.cc 2009-07-11 01:08:17 UTC (rev 7988) +++ code/gazebo/trunk/libgazebo/SimIface.cc 2009-07-11 02:18:03 UTC (rev 7989) @@ -532,3 +532,29 @@ return true; } +//////////////////////////////////////////////////////////////////////////////// +/// Get the Fiducial ID of this model +bool SimulationIface::GetModelFiducialID(const char *modelName, unsigned int &id) +{ + this->Lock(1); + + this->data->responseCount = 0; + SimulationRequestData *request; + + request = &(this->data->requests[this->data->requestCount++]); + request->type = SimulationRequestData::GET_MODEL_FIDUCIAL_ID; + + memset(request->modelName, 0, 512); + strncpy(request->modelName, modelName, 512); + request->modelName[511] = '\0'; + + this->Unlock(); + + if (!this->WaitForResponse()) + return false; + + assert(this->data->responseCount == 1); + id = data->responses[0].uintValue; + + return true; +} Modified: code/gazebo/trunk/libgazebo/gazebo.h =================================================================== --- code/gazebo/trunk/libgazebo/gazebo.h 2009-07-11 01:08:17 UTC (rev 7988) +++ code/gazebo/trunk/libgazebo/gazebo.h 2009-07-11 02:18:03 UTC (rev 7989) @@ -590,6 +590,9 @@ /// \brief Get the extents of a model public: bool GetModelExtent(const char *modelName, Vec3 &ext); + /// \brief Get the model Fiducial ID (if one global ID was set) + public: bool GetModelFiducialID(const char *modelName, unsigned int &id); + public: void GoAckWait(); public: void GoAckPost(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |