Revision: 7867
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7867&view=rev
Author:   robotos
Date:     2009-06-21 13:59:20 +0000 (Sun, 21 Jun 2009)

Log Message:
-----------
laserFiducialID and laserRetro properties for models. This not only saves 
typing but also .model files with no fiducial information can be fiducialized 
in the .world file.

Modified Paths:
--------------
    code/gazebo/trunk/server/Model.cc
    code/gazebo/trunk/server/Model.hh
    code/gazebo/trunk/server/physics/Body.cc
    code/gazebo/trunk/server/physics/Body.hh

Modified: code/gazebo/trunk/server/Model.cc
===================================================================
--- code/gazebo/trunk/server/Model.cc   2009-06-20 13:07:12 UTC (rev 7866)
+++ code/gazebo/trunk/server/Model.cc   2009-06-21 13:59:20 UTC (rev 7867)
@@ -84,6 +84,12 @@
   this->collideP = new ParamT<std::string>("collide", "all", 0);
   this->collideP->Callback( &Model::SetCollideMode, this );
 
+  this->laserFiducialP = new ParamT<int>("laserFiducialId", -1, 0);
+  this->laserFiducialP->Callback( &Model::SetLaserFiducialId, this );
+
+  this->laserRetroP = new ParamT<float>("laserRetro", -1, 0);
+  this->laserRetroP->Callback( &Model::SetLaserRetro, this );
+
   Param::End();
 
   this->graphicsHandler = NULL;
@@ -245,6 +251,9 @@
 
   this->SetCollideMode( **this->collideP );
 
+  this->SetLaserFiducialId( **this->laserFiducialP);
+  this->SetLaserRetro( **this->laserRetroP);
+
   // Create the graphics iface handler
   this->graphicsHandler = new GraphicsIfaceHandler();
   this->graphicsHandler->Load(this->GetName(), this);
@@ -975,6 +984,38 @@
 }
 
 
////////////////////////////////////////////////////////////////////////////////
+/// Set the collide mode of the model
+void Model::SetLaserFiducialId( const int &id )
+{
+  Body *body;
+
+  std::map<std::string, Body* >::iterator iter;
+
+  for (iter=this->bodies.begin(); iter!=this->bodies.end(); iter++)
+  {
+    body = iter->second;
+
+    body->SetLaserFiducialId( id );
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Set the collide mode of the model
+void Model::SetLaserRetro( const float &retro )
+{
+  Body *body;
+
+  std::map<std::string, Body* >::iterator iter;
+
+  for (iter=this->bodies.begin(); iter!=this->bodies.end(); iter++)
+  {
+    body = iter->second;
+
+    body->SetLaserRetro( retro );
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
 // Load a renderable model (like a light source).
 void Model::LoadRenderable(XMLConfigNode *node)
 {

Modified: code/gazebo/trunk/server/Model.hh
===================================================================
--- code/gazebo/trunk/server/Model.hh   2009-06-20 13:07:12 UTC (rev 7866)
+++ code/gazebo/trunk/server/Model.hh   2009-06-21 13:59:20 UTC (rev 7867)
@@ -178,6 +178,12 @@
     /// \brief Set the collide mode of the model
     public: void SetCollideMode( const std::string &m );
 
+    /// \brief Set the laser fiducial integer Id of the model
+    public: void SetLaserFiducialId( const int &id );
+
+    /// \brief Set the laser retro reflectiveness of the model
+    public: void SetLaserRetro( const float &retro );
+
     /// \brief Load a body helper function
     /// \param node XML Configuration node
     private: void LoadBody(XMLConfigNode *node);
@@ -230,6 +236,8 @@
     private: ParamT<std::string> *myBodyNameP;
     private: ParamT<bool> *enableGravityP;
     private: ParamT<bool> *enableFrictionP;
+    private: ParamT<int> *laserFiducialP;
+    private: ParamT<float> *laserRetroP;
     private: ParamT<std::string> *collideP;
 
 

Modified: code/gazebo/trunk/server/physics/Body.cc
===================================================================
--- code/gazebo/trunk/server/physics/Body.cc    2009-06-20 13:07:12 UTC (rev 
7866)
+++ code/gazebo/trunk/server/physics/Body.cc    2009-06-21 13:59:20 UTC (rev 
7867)
@@ -364,6 +364,34 @@
 }
 
 
////////////////////////////////////////////////////////////////////////////////
+/// Set the laser fiducial integer id of this body
+void Body::SetLaserFiducialId(int id)
+{
+  std::map< std::string, Geom* >::iterator giter;
+
+  for (giter = this->geoms.begin(); giter != this->geoms.end(); giter++)
+  {
+    giter->second->SetLaserFiducialId( id );
+  }
+
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+/// Set the laser retro reflectiveness of this body
+void Body::SetLaserRetro(float retro)
+{
+  std::map< std::string, Geom* >::iterator giter;
+
+  for (giter = this->geoms.begin(); giter != this->geoms.end(); giter++)
+  {
+    giter->second->SetLaserRetro( retro );
+  }
+
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
 // Initialize the body
 void Body::Init()
 {

Modified: code/gazebo/trunk/server/physics/Body.hh
===================================================================
--- code/gazebo/trunk/server/physics/Body.hh    2009-06-20 13:07:12 UTC (rev 
7866)
+++ code/gazebo/trunk/server/physics/Body.hh    2009-06-21 13:59:20 UTC (rev 
7867)
@@ -138,6 +138,12 @@
     //         with other bodies even if they share the same parent.
     public: bool GetSelfCollide();
 
+    /// \brief Set the laser fiducial integer id
+    public: void SetLaserFiducialId(int id);
+
+   /// \brief Set the laser retro reflectiveness
+    public: void SetLaserRetro(float retro);
+
     /// \brief Set the linear velocity of the body
     public: void SetLinearVel(const Vector3 &vel);
 


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

Reply via email to