Revision: 6976
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6976&view=rev
Author:   natepak
Date:     2008-08-22 18:19:44 +0000 (Fri, 22 Aug 2008)

Log Message:
-----------
Fixes to setting the joint axis

Modified Paths:
--------------
    code/gazebo/trunk/server/physics/Body.cc
    code/gazebo/trunk/server/physics/HingeJoint.cc
    code/gazebo/trunk/server/physics/Joint.cc

Modified: code/gazebo/trunk/server/physics/Body.cc
===================================================================
--- code/gazebo/trunk/server/physics/Body.cc    2008-08-21 22:07:55 UTC (rev 
6975)
+++ code/gazebo/trunk/server/physics/Body.cc    2008-08-22 18:19:44 UTC (rev 
6976)
@@ -102,10 +102,12 @@
   this->nameP->Load(node);
   this->xyzP->Load(node);
   this->rpyP->Load(node);
+  Pose3d initPose;
 
-  this->SetPosition(this->xyzP->GetValue());
-  this->SetRotation(this->rpyP->GetValue());
+  initPose.pos = **(this->xyzP);
+  initPose.rot = **(this->rpyP);
 
+
   childNode = node->GetChildByNSPrefix("geom");
 
   // Load the geometries
@@ -132,6 +134,7 @@
     this->SetGravityMode(false);
   }
 
+  this->SetPose(initPose);
 }
 
 
////////////////////////////////////////////////////////////////////////////////
@@ -268,6 +271,7 @@
    
     for (iter = this->geoms.begin(); iter != this->geoms.end(); iter++)
     {
+      //newPose = (*iter)->GetPose() - this->staticPose;
       newPose = (*iter)->GetPose() - oldPose;
       newPose += this->staticPose;
       (*iter)->SetPose(newPose);

Modified: code/gazebo/trunk/server/physics/HingeJoint.cc
===================================================================
--- code/gazebo/trunk/server/physics/HingeJoint.cc      2008-08-21 22:07:55 UTC 
(rev 6975)
+++ code/gazebo/trunk/server/physics/HingeJoint.cc      2008-08-22 18:19:44 UTC 
(rev 6976)
@@ -40,7 +40,7 @@
   this->type = Joint::HINGE;
   this->jointId = dJointCreateHinge( worldId, NULL );
 
-  this->axisP = new Param<Vector3>("axis",Vector3(0,0,1), 0);
+  this->axisP = new Param<Vector3>("axis",Vector3(0,1,0), 1);
   this->loStopP = new Param<Angle>("lowStop",-M_PI,0);
   this->hiStopP = new Param<Angle>("highStop",M_PI,0);
 }
@@ -142,8 +142,6 @@
   dJointSetHingeAxis( this->jointId, axis.x, axis.y, axis.z );
 }
 
-
-
 //////////////////////////////////////////////////////////////////////////////
 // Set the _parameter to _value
 void HingeJoint::SetParam( int parameter, double value)

Modified: code/gazebo/trunk/server/physics/Joint.cc
===================================================================
--- code/gazebo/trunk/server/physics/Joint.cc   2008-08-21 22:07:55 UTC (rev 
6975)
+++ code/gazebo/trunk/server/physics/Joint.cc   2008-08-22 18:19:44 UTC (rev 
6976)
@@ -80,7 +80,6 @@
 {
   // Name the joint
   this->nameP->Load(node);
-  this->LoadChild(node);
 
   this->body1NameP->Load(node);
   this->body2NameP->Load(node);
@@ -138,6 +137,7 @@
   this->line2->AddPoint(Vector3(0,0,0));
   this->line2->AddPoint(Vector3(0,0,0));
 
+  this->LoadChild(node);
 }
 
 
////////////////////////////////////////////////////////////////////////////////


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