Revision: 8212
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8212&view=rev
Author:   rtv
Date:     2009-08-20 22:59:06 +0000 (Thu, 20 Aug 2009)

Log Message:
-----------
fixed stageplugin

Modified Paths:
--------------
    code/stage/trunk/libstageplugin/p_actarray.cc
    code/stage/trunk/libstageplugin/p_blobfinder.cc
    code/stage/trunk/libstageplugin/p_driver.cc
    code/stage/trunk/libstageplugin/p_driver.h
    code/stage/trunk/libstageplugin/p_fiducial.cc
    code/stage/trunk/libstageplugin/p_graphics.cc
    code/stage/trunk/libstageplugin/p_gripper.cc
    code/stage/trunk/libstageplugin/p_laser.cc
    code/stage/trunk/libstageplugin/p_position.cc
    code/stage/trunk/libstageplugin/p_sonar.cc
    code/stage/trunk/libstageplugin/p_speech.cc
    code/stage/trunk/webstage/webstage.cc

Modified: code/stage/trunk/libstageplugin/p_actarray.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_actarray.cc       2009-08-20 21:42:09 UTC 
(rev 8211)
+++ code/stage/trunk/libstageplugin/p_actarray.cc       2009-08-20 22:59:06 UTC 
(rev 8212)
@@ -46,7 +46,7 @@
                                       ConfigFile* cf,
                                       int section )
 
-  : InterfaceModel( addr, driver, cf, section, Stg::MODEL_TYPE_ACTUATOR )
+  : InterfaceModel( addr, driver, cf, section, "actuator" )
 {
   //puts( "InterfacePosition constructor" );
 }

Modified: code/stage/trunk/libstageplugin/p_blobfinder.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_blobfinder.cc     2009-08-20 21:42:09 UTC 
(rev 8211)
+++ code/stage/trunk/libstageplugin/p_blobfinder.cc     2009-08-20 22:59:06 UTC 
(rev 8212)
@@ -42,7 +42,7 @@
                                StgDriver* driver,
                                ConfigFile* cf,
                                int section )
-  : InterfaceModel( addr, driver, cf, section, MODEL_TYPE_BLOBFINDER )
+  : InterfaceModel( addr, driver, cf, section, "blobfinder" )
 {
   // nothing to do for now
 }

Modified: code/stage/trunk/libstageplugin/p_driver.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_driver.cc 2009-08-20 21:42:09 UTC (rev 
8211)
+++ code/stage/trunk/libstageplugin/p_driver.cc 2009-08-20 22:59:06 UTC (rev 
8212)
@@ -227,7 +227,7 @@
                                                                                
        StgDriver* driver,
                                                                                
        ConfigFile* cf,
                                                                                
        int section,
-                                                                               
        stg_model_type_t type )
+                                                                               
        const std::string& type )
   : Interface( addr, driver, cf, section )
 {
   char* model_name = (char*)cf->ReadString(section, "model", NULL );
@@ -426,7 +426,7 @@
 
 Model*  StgDriver::LocateModel( char* basename,
                                   player_devaddr_t* addr,
-                                  stg_model_type_t type )
+                                 const std::string& type )
 {
   //printf( "attempting to find a model under model \"%s\" of type [%d]\n",
   //    basename, type );
@@ -440,7 +440,7 @@
       return NULL;
     }
 
-  if( type == MODEL_TYPE_PLAIN ) // if we don't care what type the model is
+  if( type == "" ) // if we don't care what type the model is
     return base_model;
 
   //  printf( "found base model %s\n", base_model->Token() );

Modified: code/stage/trunk/libstageplugin/p_driver.h
===================================================================
--- code/stage/trunk/libstageplugin/p_driver.h  2009-08-20 21:42:09 UTC (rev 
8211)
+++ code/stage/trunk/libstageplugin/p_driver.h  2009-08-20 22:59:06 UTC (rev 
8212)
@@ -45,7 +45,7 @@
 
   Stg::Model* LocateModel( char* basename,
                                                                        
player_devaddr_t* addr,
-                                                                       
Stg::stg_model_type_t type );
+                                                                       const 
std::string& type );
   
  protected:
 
@@ -102,7 +102,7 @@
                  StgDriver* driver,
                  ConfigFile* cf,
                  int section,
-                 Stg::stg_model_type_t type );
+                 const std::string& type );
 
   Stg::Model* mod;
 

Modified: code/stage/trunk/libstageplugin/p_fiducial.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_fiducial.cc       2009-08-20 21:42:09 UTC 
(rev 8211)
+++ code/stage/trunk/libstageplugin/p_fiducial.cc       2009-08-20 22:59:06 UTC 
(rev 8212)
@@ -52,7 +52,7 @@
                                                                                
                        StgDriver* driver,
                                                                                
                        ConfigFile* cf,
                                                                                
                        int section )
-  : InterfaceModel( addr, driver, cf, section, MODEL_TYPE_FIDUCIAL )
+  : InterfaceModel( addr, driver, cf, section, "fiducial" )
 {
 }
 

Modified: code/stage/trunk/libstageplugin/p_graphics.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_graphics.cc       2009-08-20 21:42:09 UTC 
(rev 8211)
+++ code/stage/trunk/libstageplugin/p_graphics.cc       2009-08-20 22:59:06 UTC 
(rev 8212)
@@ -181,7 +181,7 @@
 
 InterfaceGraphics2d::InterfaceGraphics2d(player_devaddr_t addr,
                StgDriver* driver, ConfigFile* cf, int section) :
-       InterfaceModel(addr, driver, cf, section, Stg::MODEL_TYPE_PLAIN) {
+       InterfaceModel(addr, driver, cf, section, "") {
        vis = new PlayerGraphics2dVis;
        mod->AddVisualizer( vis, true );
 }
@@ -275,7 +275,7 @@
 
 InterfaceGraphics3d::InterfaceGraphics3d(player_devaddr_t addr,
                StgDriver* driver, ConfigFile* cf, int section) :
-       InterfaceModel(addr, driver, cf, section, Stg::MODEL_TYPE_PLAIN) {
+       InterfaceModel(addr, driver, cf, section, "") {
        vis = new PlayerGraphics3dVis;
        mod->AddVisualizer( vis, true );
 }

Modified: code/stage/trunk/libstageplugin/p_gripper.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_gripper.cc        2009-08-20 21:42:09 UTC 
(rev 8211)
+++ code/stage/trunk/libstageplugin/p_gripper.cc        2009-08-20 22:59:06 UTC 
(rev 8212)
@@ -45,7 +45,7 @@
                                StgDriver* driver,
                                ConfigFile* cf,
                                int section )
-  : InterfaceModel( addr, driver, cf, section, MODEL_TYPE_GRIPPER )
+  : InterfaceModel( addr, driver, cf, section, "gripper" )
 {
   // nothing to do
 }

Modified: code/stage/trunk/libstageplugin/p_laser.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_laser.cc  2009-08-20 21:42:09 UTC (rev 
8211)
+++ code/stage/trunk/libstageplugin/p_laser.cc  2009-08-20 22:59:06 UTC (rev 
8212)
@@ -45,7 +45,7 @@
                                StgDriver* driver,
                                ConfigFile* cf,
                                int section )
-  : InterfaceModel( addr, driver, cf, section, MODEL_TYPE_LASER )
+  : InterfaceModel( addr, driver, cf, section, "laser" )
 {
   this->scan_id = 0;
 }

Modified: code/stage/trunk/libstageplugin/p_position.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_position.cc       2009-08-20 21:42:09 UTC 
(rev 8211)
+++ code/stage/trunk/libstageplugin/p_position.cc       2009-08-20 22:59:06 UTC 
(rev 8212)
@@ -50,7 +50,7 @@
                                       ConfigFile* cf,
                                       int section )
                                                   
-  : InterfaceModel( addr, driver, cf, section, MODEL_TYPE_POSITION )
+  : InterfaceModel( addr, driver, cf, section, "position" )
 {
   //puts( "InterfacePosition constructor" );
 }

Modified: code/stage/trunk/libstageplugin/p_sonar.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_sonar.cc  2009-08-20 21:42:09 UTC (rev 
8211)
+++ code/stage/trunk/libstageplugin/p_sonar.cc  2009-08-20 22:59:06 UTC (rev 
8212)
@@ -47,7 +47,7 @@
                                StgDriver* driver,
                                ConfigFile* cf,
                                int section )
-  : InterfaceModel( id, driver, cf, section, MODEL_TYPE_RANGER )
+  : InterfaceModel( id, driver, cf, section, "ranger" )
 {
   //this->data_len = sizeof(player_sonar_data_t);
   //this->cmd_len = 0;

Modified: code/stage/trunk/libstageplugin/p_speech.cc
===================================================================
--- code/stage/trunk/libstageplugin/p_speech.cc 2009-08-20 21:42:09 UTC (rev 
8211)
+++ code/stage/trunk/libstageplugin/p_speech.cc 2009-08-20 22:59:06 UTC (rev 
8212)
@@ -41,7 +41,7 @@
                               ConfigFile* cf,
                               int section )
   
-  : InterfaceModel( addr, driver, cf, section, MODEL_TYPE_PLAIN )
+  : InterfaceModel( addr, driver, cf, section, "" )
 {
   // nothing to do
 }

Modified: code/stage/trunk/webstage/webstage.cc
===================================================================
--- code/stage/trunk/webstage/webstage.cc       2009-08-20 21:42:09 UTC (rev 
8211)
+++ code/stage/trunk/webstage/webstage.cc       2009-08-20 22:59:06 UTC (rev 
8212)
@@ -194,10 +194,8 @@
         Model*mod = world->GetModel( name.c_str() );
         if(mod){
                stg_model_type_t type = mod->GetModelType();
-               if(type == MODEL_TYPE_POSITION){
-                       
-                                                               
-                       
+               if(type == "position") {
+
                  websim::Pose p;
                  websim::Velocity v;
                  websim::Acceleration a;
@@ -218,7 +216,7 @@
                        
                        
 
-               }else if(type == MODEL_TYPE_LASER){
+               }else if(type == "laser"){
 
                  uint32_t resolution;
                  double fov;
@@ -241,7 +239,7 @@
                  WebSim::GetLaserData(name, t, resolution, fov, p, ranges, 
format, response, xmlparent);
                         
 
-               }else if(type == MODEL_TYPE_RANGER){
+               }else if(type == "ranger"){
 
                  std::vector<websim::Pose> p;
                  std::vector<double> ranges;
@@ -270,7 +268,7 @@
                  WebSim::GetRangerData(name, t, p, ranges, format, response, 
xmlparent);
 
 
-               }else if(type == MODEL_TYPE_FIDUCIAL){
+               }else if(type == "fiducial"){
 
                  ModelFiducial::Fiducial* fids;
                  unsigned int n=0;
@@ -312,37 +310,7 @@
         return true;
   }
   
-  bool GetModelType(const std::string& name,                                   
                                
-                                                 std::string& type )
-  {
-        
-        Model*mod = world->GetModel( name.c_str() );
-        if(mod)
-               {
-                 switch( mod->GetModelType() )
-                        {
-                        case MODEL_TYPE_POSITION:
-                               type =  "Position"; 
-                               break;
-                        case MODEL_TYPE_LASER:
-                               type =  "Laser"; 
-                               break;
-                        case MODEL_TYPE_RANGER:
-                               type = "Ranger"; 
-                               break;
-                        case MODEL_TYPE_FIDUCIAL:
-                               type = "Fiducial";
-                               break;
-                        default:
-                               type = "";
-                        }              
-                 return true;
-               }         
-  return false;  
-}
 
-
-
   virtual bool SetModelPVA(const std::string& name, 
                                                                        const 
websim::Pose& p,
                                                                        const 
websim::Velocity& v,


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to