Revision: 7845
http://playerstage.svn.sourceforge.net/playerstage/?rev=7845&view=rev
Author: rtv
Date: 2009-06-12 22:16:33 +0000 (Fri, 12 Jun 2009)
Log Message:
-----------
wgz without syncing
Modified Paths:
--------------
code/gazebo/trunk/webgazebo/CMakeLists.txt
code/gazebo/trunk/webgazebo/WebGazebo.cc
code/gazebo/trunk/webgazebo/WebGazebo.hh
code/gazebo/trunk/webgazebo/main.cc
Modified: code/gazebo/trunk/webgazebo/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/webgazebo/CMakeLists.txt 2009-06-11 16:53:37 UTC (rev
7844)
+++ code/gazebo/trunk/webgazebo/CMakeLists.txt 2009-06-12 22:16:33 UTC (rev
7845)
@@ -4,6 +4,9 @@
../server/Angle.cc
)
+MESSAGE( STATUS "websim include dirs ${WEBSIM_INCLUDE_DIRS}" )
+MESSAGE( STATUS "websim library dirs ${WEBSIM_LIBRARY_DIRS}" )
+
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/server
${CMAKE_SOURCE_DIR}/libgazebo
@@ -12,13 +15,14 @@
)
LINK_DIRECTORIES(
- ${WEBSIM_LINK_DIRS}
+ ${WEBSIM_LIBRARY_DIRS}
${boost_library_dirs}
${CMAKE_BINARY_DIR}/libgazebo
)
SET_SOURCE_FILES_PROPERTIES(${sources} PROPERTIES COMPILE_FLAGS
- '-DINSTALL_PREFIX="/usr/local/"')
+ '-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}"')
+
ADD_LIBRARY(webgz ${sources})
ADD_EXECUTABLE(webgazebo main.cc)
@@ -28,5 +32,7 @@
TARGET_LINK_LIBRARIES( webgazebo gazebo event ${WEBSIM_LINK_LIBS}
${boost_libraries} webgz)
TARGET_LINK_LIBRARIES( client gazebo event ${WEBSIM_LINK_LIBS}
${boost_libraries} webgz)
-INSTALL(TARGETS webgazebo DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
-INSTALL(TARGETS webgz DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
+INSTALL(TARGETS webgazebo webgz client
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ RUNTIME DESTINATION bin )
Modified: code/gazebo/trunk/webgazebo/WebGazebo.cc
===================================================================
--- code/gazebo/trunk/webgazebo/WebGazebo.cc 2009-06-11 16:53:37 UTC (rev
7844)
+++ code/gazebo/trunk/webgazebo/WebGazebo.cc 2009-06-12 22:16:33 UTC (rev
7845)
@@ -44,7 +44,8 @@
const std::string& host, unsigned short port,
double dtol, double atol) :
websim::WebSim(host, port),
- sq_dist_tol(dtol*dtol), sq_ang_tol(atol*atol)
+ sq_dist_tol(dtol*dtol),
+ sq_ang_tol(atol*atol)
{
// Hook up to Gazebo
printf("[webgazebo] Opening Gazebo simulation interface...");
@@ -55,7 +56,9 @@
this->client->ConnectWait(0, GZ_CLIENT_ID_USER_FIRST);
// Open the Simulation Interface; let exceptions leak out
this->simIface->Open(this->client, "default");
- this->factoryIface->Open(this->client, "factory_iface");
+ puts( "(opened sim interface)" );
+ //this->factoryIface->Open(this->client, "factory_iface");
+ //puts( "(opened factory interface)" );
puts("Done.");
puts("[webgazebo] Ready");
@@ -301,8 +304,7 @@
WebGazebo::Go(double t)
{
unsigned int us = (unsigned int)rint(t*1e6);
- this->simIface->Go(us,
- boost::bind(&WebGazebo::GoCallback, this));
+ this->simIface->Go(us, boost::bind(&WebGazebo::GoCallback, this));
// Wait for the callback to fire
boost::mutex::scoped_lock lock(this->goMutex);
this->goCond.wait(lock);
Modified: code/gazebo/trunk/webgazebo/WebGazebo.hh
===================================================================
--- code/gazebo/trunk/webgazebo/WebGazebo.hh 2009-06-11 16:53:37 UTC (rev
7844)
+++ code/gazebo/trunk/webgazebo/WebGazebo.hh 2009-06-12 22:16:33 UTC (rev
7845)
@@ -35,58 +35,58 @@
// libgazebo;
#include "gazebo.h"
-#include "websim/websim.hh"
+#include "websim.hh"
class WebGazebo : public websim::WebSim
{
- public:
- WebGazebo(const std::string& fedfile,
- const std::string& host, unsigned short port,
- double dtol, double atol);
- virtual ~WebGazebo();
+public:
+ WebGazebo(const std::string& fedfile,
+ const std::string& host, unsigned short port,
+ double dtol, double atol);
+ virtual ~WebGazebo();
- bool Go(double t);
+ bool Go(double t);
- // Interface to be implemented by simulators
- virtual bool CreateModel(const std::string& name,
- const std::string& type,
- std::string& error);
- virtual bool DeleteModel(const std::string& name,
- std::string& error);
- virtual bool SetModelPVA(const std::string& name,
- const websim::Pose& p,
- const websim::Velocity& v,
- const websim::Acceleration& a,
- std::string& error);
- virtual bool GetModelPVA(const std::string& name,
- websim::Time &t,
- websim::Pose& p,
- websim::Velocity& v,
- websim::Acceleration& a,
- std::string& error);
+ // Interface to be implemented by simulators
+ virtual bool CreateModel(const std::string& name,
+ const std::string& type,
+ std::string& error);
+ virtual bool DeleteModel(const std::string& name,
+ std::string& error);
+ virtual bool SetModelPVA(const std::string& name,
+ const websim::Pose& p,
+ const websim::Velocity& v,
+ const websim::Acceleration& a,
+ std::string& error);
+ virtual bool GetModelPVA(const std::string& name,
+ websim::Time &t,
+ websim::Pose& p,
+ websim::Velocity& v,
+ websim::Acceleration& a,
+ std::string& error);
virtual bool GetLaserData(const std::string& name,
-
websim::Time& t,
-
uint32_t& resolution,
- double&
fov,
-
websim::Pose& p,
-
std::vector<double>& ranges,
-
std::string& response) { return true;}
+ websim::Time& t,
+ uint32_t& resolution,
+ double& fov,
+ websim::Pose& p,
+ std::vector<double>& ranges,
+ std::string& response) { return true;}
virtual bool GetRangerData(const std::string& name,
-
websim::Time& t,
-
std::vector<websim::Pose>& p,
-
std::vector<double>& ranges,
- std::string&
response) {return true;}
+ websim::Time& t,
+ std::vector<websim::Pose>& p,
+ std::vector<double>& ranges,
+ std::string& response) {return true;}
- virtual bool GetModelExtent(const std::string& name,
- double&
bx,
- double&
by,
- double&
bz,
-
websim::Pose& center,
-
std::string& response) {return true;}
+ virtual bool GetModelExtent(const std::string& name,
+ double& bx,
+ double& by,
+ double& bz,
+ websim::Pose& center,
+ std::string& response) {return true;}
virtual bool GetNumberOfRobots(unsigned int& n) {return true;}
@@ -96,22 +96,25 @@
/** Get the current simulation time */
virtual websim::Time GetTime();
- private:
- double sq_dist_tol, sq_ang_tol;
- boost::mutex goMutex;
- boost::condition goCond;
+private:
+ double sq_dist_tol;
+ double sq_ang_tol;
- gazebo::Client *client;
- gazebo::SimulationIface *simIface;
- gazebo::FactoryIface *factoryIface;
+ boost::mutex goMutex;
+ boost::condition goCond;
- // Available models
- std::map<std::string,int> models;
+ gazebo::Client *client;
+ gazebo::SimulationIface *simIface;
+ gazebo::FactoryIface *factoryIface;
- bool CheckTolerances(gazebo::Pose p, gazebo::Pose q);
- bool GetModel(const std::string& name,
- const std::string& type,
- std::string& xmldata,
- std::string& response);
- void GoCallback();
+ // Available models
+ std::map<std::string,int> models;
+
+ bool CheckTolerances(gazebo::Pose p, gazebo::Pose q);
+ bool GetModel(const std::string& name,
+ const std::string& type,
+ std::string& xmldata,
+ std::string& response);
+ void GoCallback();
};
+
Modified: code/gazebo/trunk/webgazebo/main.cc
===================================================================
--- code/gazebo/trunk/webgazebo/main.cc 2009-06-11 16:53:37 UTC (rev 7844)
+++ code/gazebo/trunk/webgazebo/main.cc 2009-06-12 22:16:33 UTC (rev 7845)
@@ -20,7 +20,7 @@
*/
/* Desc: HTTP portal to libgazebo
- * Author: Brian Gerkey
+ * Author: Brian Gerkey, Richard Vaughan
* Date: 9 March 2009
* SVN: $Id: gazebo.h 7398 2009-03-09 07:21:49Z natepak $
*/
@@ -54,8 +54,12 @@
for(;;)
{
+ //puts( "WGZ LOOP START" );
//wg.Update();
- wg.Go(1.0);
+ //wg.Go(1.0);
+ //puts( "WGZ LOOP END" );
+ wg.Wait();
+ usleep( 1e3 );
}
return 0;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit