Revision: 7432
http://playerstage.svn.sourceforge.net/playerstage/?rev=7432&view=rev
Author: gerkey
Date: 2009-03-10 06:52:24 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
webgazebo that works with websim; working on state machine
Modified Paths:
--------------
code/branches/federation/gazebo/webgazebo/WebGazebo.cc
code/branches/federation/gazebo/webgazebo/WebGazebo.hh
code/branches/federation/gazebo/webgazebo/main.cc
Modified: code/branches/federation/gazebo/webgazebo/WebGazebo.cc
===================================================================
--- code/branches/federation/gazebo/webgazebo/WebGazebo.cc 2009-03-10
06:02:26 UTC (rev 7431)
+++ code/branches/federation/gazebo/webgazebo/WebGazebo.cc 2009-03-10
06:52:24 UTC (rev 7432)
@@ -258,3 +258,16 @@
response = "DeleteModel not implemented";
return false;
}
+
+void
+WebGazebo::GoCallback()
+{
+ puts("GoCallback");
+}
+
+bool
+WebGazebo::Go(double t)
+{
+ this->simIface->Go((unsigned int)rint(t/1e6),
+ boost::bind(&WebGazebo::GoCallback, this));
+}
Modified: code/branches/federation/gazebo/webgazebo/WebGazebo.hh
===================================================================
--- code/branches/federation/gazebo/webgazebo/WebGazebo.hh 2009-03-10
06:02:26 UTC (rev 7431)
+++ code/branches/federation/gazebo/webgazebo/WebGazebo.hh 2009-03-10
06:52:24 UTC (rev 7432)
@@ -45,6 +45,8 @@
const std::string& host, int port,
double dtol, double atol);
virtual ~WebGazebo();
+
+ bool Go(double t);
// Interface to be implemented by simulators
virtual bool CreateModel(const std::string& name,
@@ -65,6 +67,8 @@
private:
double sq_dist_tol, sq_ang_tol;
+ boost::condition goMutex;
+ boost::condition goCond;
gazebo::Client *client;
gazebo::SimulationIface *simIface;
@@ -78,4 +82,5 @@
const std::string& type,
std::string& xmldata,
std::string& response);
+ void GoCallback();
};
Modified: code/branches/federation/gazebo/webgazebo/main.cc
===================================================================
--- code/branches/federation/gazebo/webgazebo/main.cc 2009-03-10 06:02:26 UTC
(rev 7431)
+++ code/branches/federation/gazebo/webgazebo/main.cc 2009-03-10 06:52:24 UTC
(rev 7432)
@@ -29,7 +29,7 @@
#include <stdlib.h>
-#define USAGE "USAGE: webgazebo -f <file.fed> [-h <host>] [-p <port>] [-d
<dtol>] [-a <atol>]\n"
+#define USAGE "USAGE: webgazebo [-f <file.fed>] [-h <host>] [-p <port>] [-d
<dtol>] [-a <atol>]\n"
#define DEFAULT_PORT 8000
#define DEFAULT_HOST "localhost"
@@ -50,16 +50,12 @@
exit(1);
}
- try
+ WebGazebo wg(g_fedfile, g_host, g_port, g_dtol, g_atol);
+
+ for(;;)
{
- WebGazebo wg(g_fedfile, g_host, g_port, g_dtol, g_atol);
wg.Update();
}
- catch(std::string e)
- {
- fprintf(stderr, "Gazebo exception:\n %s\n", e.c_str());
- exit(1);
- }
return 0;
}
@@ -108,9 +104,6 @@
return false;
}
}
-
- if((g_fedfile.size() == 0) || (g_host.size() == 0) || (g_port == 0))
- return false;
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