Revision: 8362
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8362&view=rev
Author:   natepak
Date:     2009-11-03 22:07:22 +0000 (Tue, 03 Nov 2009)

Log Message:
-----------
Added SetForce to joints and fixed the jointforce controller

Modified Paths:
--------------
    code/gazebo/trunk/server/controllers/opaque/jointforce/JointForce.cc
    code/gazebo/trunk/server/physics/Joint.hh

Modified: code/gazebo/trunk/server/controllers/opaque/jointforce/JointForce.cc
===================================================================
--- code/gazebo/trunk/server/controllers/opaque/jointforce/JointForce.cc        
2009-11-03 19:54:15 UTC (rev 8361)
+++ code/gazebo/trunk/server/controllers/opaque/jointforce/JointForce.cc        
2009-11-03 22:07:22 UTC (rev 8362)
@@ -104,21 +104,41 @@
     bt1 = this->joints[i]->GetBodyTorque(0);
     bt2 = this->joints[i]->GetBodyTorque(1);
 
-    *(ptr++) = bf1.x; 
-    *(ptr++) = bf1.y; 
-    *(ptr++) = bf1.z; 
+    *ptr = bf1.x; 
+    ptr += sizeof(double);
 
-    *(ptr++) = bt1.x; 
-    *(ptr++) = bt1.y; 
-    *(ptr++) = bt1.z; 
+    *ptr = bf1.y; 
+    ptr += sizeof(double);
 
-    *(ptr++) = bf2.x; 
-    *(ptr++) = bf2.y; 
-    *(ptr++) = bf2.z; 
+    *ptr = bf1.z; 
+    ptr += sizeof(double);
 
-    *(ptr++) = bt2.x; 
-    *(ptr++) = bt2.y; 
-    *(ptr++) = bt2.z; 
+    *ptr++ = bt1.x; 
+    ptr += sizeof(double);
+
+    *ptr++ = bt1.y; 
+    ptr += sizeof(double);
+
+    *ptr++ = bt1.z; 
+    ptr += sizeof(double);
+
+    *ptr = bf2.x; 
+    ptr += sizeof(double);
+
+    *ptr = bf2.y; 
+    ptr += sizeof(double);
+
+    *ptr = bf2.z; 
+    ptr += sizeof(double);
+
+    *ptr = bt2.x; 
+    ptr += sizeof(double);
+
+    *ptr = bt2.y; 
+    ptr += sizeof(double);
+
+    *ptr = bt2.z; 
+    ptr += sizeof(double);
   }
 
   this->myIface->Unlock();

Modified: code/gazebo/trunk/server/physics/Joint.hh
===================================================================
--- code/gazebo/trunk/server/physics/Joint.hh   2009-11-03 19:54:15 UTC (rev 
8361)
+++ code/gazebo/trunk/server/physics/Joint.hh   2009-11-03 22:07:22 UTC (rev 
8362)
@@ -120,6 +120,12 @@
 
     /// \brief Get the rotation rate of an axis(index)
     public: virtual double GetVelocity(int index) const = 0;
+
+    /// \brief Set the force applied to an axis
+    public: virtual void SetForce(int index, double f) {}
+
+    /// \brief Get the force applied to an axis
+    public: virtual double GetForce(int index) {return 0;}
  
     /// \brief Set the max allowed force of an axis(index).
     public: virtual void SetMaxForce(int index, double t) = 0;


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

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to