Revision: 7129 http://playerstage.svn.sourceforge.net/playerstage/?rev=7129&view=rev Author: natepak Date: 2008-11-12 19:38:15 +0000 (Wed, 12 Nov 2008)
Log Message: ----------- Moved SuspensionCfmP from Joint to Hinge2Joint Modified Paths: -------------- code/gazebo/trunk/server/physics/Hinge2Joint.cc code/gazebo/trunk/server/physics/Hinge2Joint.hh code/gazebo/trunk/server/physics/Joint.cc code/gazebo/trunk/server/physics/Joint.hh Modified: code/gazebo/trunk/server/physics/Hinge2Joint.cc =================================================================== --- code/gazebo/trunk/server/physics/Hinge2Joint.cc 2008-11-12 19:37:09 UTC (rev 7128) +++ code/gazebo/trunk/server/physics/Hinge2Joint.cc 2008-11-12 19:38:15 UTC (rev 7129) @@ -45,6 +45,7 @@ this->hiStop1P = new ParamT<Angle>("highStop1",M_PI,0); this->loStop2P = new ParamT<Angle>("lowStop2",-M_PI,0); this->hiStop2P = new ParamT<Angle>("highStop2",M_PI,0); + this->suspensionCfmP = new ParamT<double>("suspensionCfm",0.0,0); Param::End(); } @@ -59,6 +60,7 @@ delete this->hiStop1P; delete this->loStop2P; delete this->hiStop2P; + delete this->suspensionCfmP; } ////////////////////////////////////////////////////////////////////////////// @@ -71,6 +73,7 @@ this->hiStop1P->Load(node); this->loStop2P->Load(node); this->hiStop2P->Load(node); + this->suspensionCfmP->Load(node); this->SetAxis1(**(this->axis1P)); this->SetAxis2(**(this->axis2P)); @@ -86,6 +89,9 @@ this->SetParam(dParamHiStop2, this->hiStop2P->GetValue().GetAsRadian()); this->SetParam(dParamLoStop2, this->loStop2P->GetValue().GetAsRadian()); this->SetParam(dParamHiStop2, this->hiStop2P->GetValue().GetAsRadian()); + + // Suspension CFM is only valid for Hinge2 joints + this->SetParam(dParamSuspensionCFM, **(this->suspensionCfmP)); } ////////////////////////////////////////////////////////////////////////////// @@ -99,6 +105,8 @@ stream << prefix << *(this->axis2P) << "\n"; stream << prefix << *(this->loStop2P) << "\n"; stream << prefix << *(this->hiStop2P) << "\n"; + + stream << prefix << " " << *(this->suspensionCfmP) << "\n"; } ////////////////////////////////////////////////////////////////////////////// Modified: code/gazebo/trunk/server/physics/Hinge2Joint.hh =================================================================== --- code/gazebo/trunk/server/physics/Hinge2Joint.hh 2008-11-12 19:37:09 UTC (rev 7128) +++ code/gazebo/trunk/server/physics/Hinge2Joint.hh 2008-11-12 19:38:15 UTC (rev 7129) @@ -154,6 +154,8 @@ private: ParamT<Vector3> *axis2P; private: ParamT<Angle> *loStop2P; private: ParamT<Angle> *hiStop2P; + + private: ParamT<double> *suspensionCfmP; }; /// \} Modified: code/gazebo/trunk/server/physics/Joint.cc =================================================================== --- code/gazebo/trunk/server/physics/Joint.cc 2008-11-12 19:37:09 UTC (rev 7128) +++ code/gazebo/trunk/server/physics/Joint.cc 2008-11-12 19:38:15 UTC (rev 7129) @@ -44,12 +44,12 @@ Param::Begin(&this->parameters); this->erpP = new ParamT<double>("erp",0.4,0); this->cfmP = new ParamT<double>("cfm",10e-3,0); - this->suspensionCfmP = new ParamT<double>("suspensionCfm",0.0,0); this->body1NameP = new ParamT<std::string>("body1",std::string(),1); this->body2NameP = new ParamT<std::string>("body2",std::string(),1); this->anchorBodyNameP = new ParamT<std::string>("anchor",std::string(),0); this->anchorOffsetP = new ParamT<Vector3>("anchorOffset",Vector3(0,0,0), 0); this->provideFeedbackP = new ParamT<bool>("provideFeedback", false, 0); + this->fudgeFactorP = new ParamT<double>( "fudgeFactor", 1.0, 0 ); Param::End(); } @@ -61,12 +61,12 @@ dJointDestroy( this->jointId ); delete this->erpP; delete this->cfmP; - delete this->suspensionCfmP; delete this->body1NameP; delete this->body2NameP; delete this->anchorBodyNameP; delete this->anchorOffsetP; delete this->provideFeedbackP; + delete this->fudgeFactorP; } @@ -90,8 +90,8 @@ this->anchorOffsetP->Load(node); this->erpP->Load(node); this->cfmP->Load(node); - this->suspensionCfmP->Load(node); this->provideFeedbackP->Load(node); + this->fudgeFactorP->Load(node); Body *body1 = this->model->GetBody( **(this->body1NameP)); Body *body2 = this->model->GetBody(**(this->body2NameP)); @@ -107,8 +107,11 @@ // Set joint parameters this->SetParam(dParamSuspensionERP, **(this->erpP)); - this->SetParam(dParamSuspensionCFM, **(this->suspensionCfmP)); this->SetParam(dParamCFM, **(this->cfmP)); + this->SetParam(dParamFudgeFactor, **(this->fudgeFactorP)); + this->SetParam(dParamVel,0); + this->SetParam(dParamFMax,0); + this->SetParam(dParamBounce, 0); this->Attach(body1,body2); @@ -169,7 +172,7 @@ stream << prefix << " " << *(this->erpP) << "\n"; stream << prefix << " " << *(this->cfmP) << "\n"; - stream << prefix << " " << *(this->suspensionCfmP) << "\n"; + stream << prefix << " " << *(this->fudgeFactorP) << "\n"; std::string p = prefix + " "; this->SaveChild(p,stream); Modified: code/gazebo/trunk/server/physics/Joint.hh =================================================================== --- code/gazebo/trunk/server/physics/Joint.hh 2008-11-12 19:37:09 UTC (rev 7128) +++ code/gazebo/trunk/server/physics/Joint.hh 2008-11-12 19:38:15 UTC (rev 7129) @@ -156,12 +156,12 @@ /// Name of this joint private: ParamT<double> *erpP; private: ParamT<double> *cfmP; - private: ParamT<double> *suspensionCfmP; private: ParamT<std::string> *body1NameP; private: ParamT<std::string> *body2NameP; private: ParamT<std::string> *anchorBodyNameP; private: ParamT<Vector3> *anchorOffsetP; private: ParamT<bool> *provideFeedbackP; + private: ParamT<double> *fudgeFactorP; /// Feedback data for this joint private: dJointFeedback *feedback; 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