Revision: 7164
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7164&view=rev
Author:   natepak
Date:     2008-11-21 03:39:28 +0000 (Fri, 21 Nov 2008)

Log Message:
-----------
Fixed the problem associated with creating unit_box meshes

Modified Paths:
--------------
    
code/gazebo/branches/ogre-1.4.9/server/controllers/actarray/bandit/Bandit_Actarray.cc
    
code/gazebo/branches/ogre-1.4.9/server/controllers/actarray/generic/Generic_Actarray.cc
    code/gazebo/branches/ogre-1.4.9/server/rendering/OgreSimpleShape.cc
    code/gazebo/branches/ogre-1.4.9/server/rendering/OgreVisual.cc

Modified: 
code/gazebo/branches/ogre-1.4.9/server/controllers/actarray/bandit/Bandit_Actarray.cc
===================================================================
--- 
code/gazebo/branches/ogre-1.4.9/server/controllers/actarray/bandit/Bandit_Actarray.cc
       2008-11-21 02:31:05 UTC (rev 7163)
+++ 
code/gazebo/branches/ogre-1.4.9/server/controllers/actarray/bandit/Bandit_Actarray.cc
       2008-11-21 03:39:28 UTC (rev 7164)
@@ -151,11 +151,12 @@
       angle = cmdAngle - joint->GetAngle();
 
       if (fabs(angle) > 0.01)
-      {
         joint->SetParam( dParamVel, **(this->gainsP[i]) * angle);
-        joint->SetParam( dParamFMax, **(this->forcesP[i]) );
-      }
+      else
+        joint->SetParam( dParamVel, 0);
 
+      joint->SetParam( dParamFMax, **(this->forcesP[i]) );
+
     }
     else if (this->myIface->data->joint_mode[i] == 
GAZEBO_ACTARRAY_JOINT_SPEED_MODE)
     {

Modified: 
code/gazebo/branches/ogre-1.4.9/server/controllers/actarray/generic/Generic_Actarray.cc
===================================================================
--- 
code/gazebo/branches/ogre-1.4.9/server/controllers/actarray/generic/Generic_Actarray.cc
     2008-11-21 02:31:05 UTC (rev 7163)
+++ 
code/gazebo/branches/ogre-1.4.9/server/controllers/actarray/generic/Generic_Actarray.cc
     2008-11-21 03:39:28 UTC (rev 7164)
@@ -153,10 +153,11 @@
     delta_position = target_position - actual_position;
 
     if (fabs(delta_position) > tolerances[i])
-    {
       joint->SetParam( dParamVel,  this->gains[i] * delta_position);
+    else
+      joint->SetParam( dParamVel,  0);
+
       joint->SetParam( dParamFMax, this->forces[i] );
-    }
 
     this->myIface->data->actuators[i].position = actual_position;
     this->myIface->data->actuators[i].speed = actual_speed;

Modified: code/gazebo/branches/ogre-1.4.9/server/rendering/OgreSimpleShape.cc
===================================================================
--- code/gazebo/branches/ogre-1.4.9/server/rendering/OgreSimpleShape.cc 
2008-11-21 02:31:05 UTC (rev 7163)
+++ code/gazebo/branches/ogre-1.4.9/server/rendering/OgreSimpleShape.cc 
2008-11-21 03:39:28 UTC (rev 7164)
@@ -177,6 +177,9 @@
   size_t currOffset = 0;
   int i,j,k;
 
+  if (Ogre::MeshManager::getSingleton().resourceExists(name))
+    return;
+
   // Create a new mesh specifically for manual definition.
   mesh = Ogre::MeshManager::getSingleton().createManual(name,
          Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);

Modified: code/gazebo/branches/ogre-1.4.9/server/rendering/OgreVisual.cc
===================================================================
--- code/gazebo/branches/ogre-1.4.9/server/rendering/OgreVisual.cc      
2008-11-21 02:31:05 UTC (rev 7163)
+++ code/gazebo/branches/ogre-1.4.9/server/rendering/OgreVisual.cc      
2008-11-21 03:39:28 UTC (rev 7164)
@@ -23,6 +23,7 @@
  * Date: 14 Dec 2007
  * SVN: $Id$
  */
+
 #include <Ogre.h>
 #include "OgreSimpleShape.hh"
 #include "Entity.hh"
@@ -136,7 +137,15 @@
       }
     }
 
-    obj = 
(Ogre::MovableObject*)this->sceneNode->getCreator()->createEntity(stream.str(), 
meshName);
+    if ( this->sceneNode->getCreator()->hasEntity( meshName ) )
+    {
+      obj = 
(Ogre::MovableObject*)this->sceneNode->getCreator()->getEntity(meshName);
+    }
+    else
+    {
+      obj = 
(Ogre::MovableObject*)this->sceneNode->getCreator()->createEntity(stream.str(), 
meshName);
+    }
+
   }
   catch (Ogre::Exception e)
   {
@@ -188,7 +197,6 @@
 
   // Allow the mesh to cast shadows
   this->SetCastShadows(this->castShadowsP->GetValue());
-
 }
 
 


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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to