Revision: 7863
http://playerstage.svn.sourceforge.net/playerstage/?rev=7863&view=rev
Author: asadat
Date: 2009-06-19 22:53:59 +0000 (Fri, 19 Jun 2009)
Log Message:
-----------
methods of websim is added to web gazebo.
Modified Paths:
--------------
code/gazebo/trunk/CMakeLists.txt
code/gazebo/trunk/webgazebo/Properties.cc
code/gazebo/trunk/webgazebo/WebGazebo.cc
code/gazebo/trunk/webgazebo/WebGazebo.hh
Modified: code/gazebo/trunk/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/CMakeLists.txt 2009-06-19 22:37:39 UTC (rev 7862)
+++ code/gazebo/trunk/CMakeLists.txt 2009-06-19 22:53:59 UTC (rev 7863)
@@ -30,7 +30,7 @@
SET (gazebocontroller_sources_desc "List of controller sources"
CACHE INTERNAL "Gazebo controller sources list description" FORCE)
-SET (OGRE_VERSION 1.6.1 CACHE INTERNAL "Ogre version requirement" FORCE)
+SET (OGRE_VERSION 1.6.2 CACHE INTERNAL "Ogre version requirement" FORCE)
SET (FREEIMAGE_MAJOR_VERSION 3 CACHE INTERNAL "FreeImage major version
requirement" FORCE)
SET (FREEIMAGE_MINOR_VERSION 10 CACHE INTERNAL "FreeImage minor version
requirement" FORCE)
Modified: code/gazebo/trunk/webgazebo/Properties.cc
===================================================================
--- code/gazebo/trunk/webgazebo/Properties.cc 2009-06-19 22:37:39 UTC (rev
7862)
+++ code/gazebo/trunk/webgazebo/Properties.cc 2009-06-19 22:53:59 UTC (rev
7863)
@@ -120,6 +120,57 @@
return true;
}
+bool
+WebGazebo::GetModelData(const std::string& name,
+
std::string& response,
+
websim::Format format,
+ void*
xmlnode )
+{/*
+ puts("data request:");
+ puts(name.c_str());
+ std::string mname = name;
+ int i=mname.find(".");
+ if(i>0){
+ mname.erase(i,1);
+ mname.insert(i,"-");
+ }
+
+ websim::Time t= GetTime();
+ puts("laser:::");
+ puts(mname.c_str());
+
+ this->laserIface->Open(this->client, mname);
+ uint32_t resolution;
+ double fov;
+ websim::Pose p;
+ std::vector<double> ranges;
+
+ p.x = laserIface->data->pose.pos.x;
+ p.y = laserIface->data->pose.pos.y;
+ p.z = laserIface->data->pose.pos.z;
+ p.r = laserIface->data->pose.roll;
+ p.p = laserIface->data->pose.pitch;
+ p.a = laserIface->data->pose.yaw;
+
+ //resolution = laserIface->data->res_angle;
+
+ int count = laserIface->data->range_count;
+
+ float maxRange = 0;
+ for (int i = 0; i < count; i++)
+ {
+ ranges.push_back(laserIface->data->ranges[i]);
+
+ }
+
+ WebSim::GetLaserData(name, t, resolution, fov, p, ranges, format, response,
xmlnode);
+
+ this->laserIface->Close();
+*/
+ return true;
+
+}
+
bool
WebGazebo::CheckTolerances(gazebo::Pose p, gazebo::Pose q)
{
Modified: code/gazebo/trunk/webgazebo/WebGazebo.cc
===================================================================
--- code/gazebo/trunk/webgazebo/WebGazebo.cc 2009-06-19 22:37:39 UTC (rev
7862)
+++ code/gazebo/trunk/webgazebo/WebGazebo.cc 2009-06-19 22:53:59 UTC (rev
7863)
@@ -50,6 +50,7 @@
this->client = new gazebo::Client();
this->simIface = new gazebo::SimulationIface();
this->factoryIface = new gazebo::FactoryIface();
+ this->laserIface = new gazebo::LaserIface();
this->client->ConnectWait(0, GZ_CLIENT_ID_USER_FIRST);
// Open the Simulation Interface; let exceptions leak out
this->simIface->Open(this->client, "default");
@@ -63,6 +64,7 @@
WebGazebo::~WebGazebo()
{
+ delete this->laserIface;
delete this->simIface;
delete this->client;
}
Modified: code/gazebo/trunk/webgazebo/WebGazebo.hh
===================================================================
--- code/gazebo/trunk/webgazebo/WebGazebo.hh 2009-06-19 22:37:39 UTC (rev
7862)
+++ code/gazebo/trunk/webgazebo/WebGazebo.hh 2009-06-19 22:53:59 UTC (rev
7863)
@@ -65,22 +65,20 @@
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;}
+ virtual bool GetModelType(const std::string& name, std::string& type){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;}
+
+ virtual bool GetModelData(const std::string& name,
+
std::string& response,
+
websim::Format format,
+ void*
xmlnode );
+
+
+ virtual bool GetModelChildren(const std::string& model,
+
std::vector<std::string>& children){return true;}
+
virtual bool GetModelExtent(const std::string& name,
double& bx,
double& by,
@@ -106,7 +104,7 @@
gazebo::Client *client;
gazebo::SimulationIface *simIface;
gazebo::FactoryIface *factoryIface;
-
+ gazebo::LaserIface *laserIface;
// Available models
std::map<std::string,int> models;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit