From: <na...@us...> - 2008-08-20 15:26:10
|
Revision: 6967 http://playerstage.svn.sourceforge.net/playerstage/?rev=6967&view=rev Author: natepak Date: 2008-08-20 22:26:19 +0000 (Wed, 20 Aug 2008) Log Message: ----------- Added patch 2035591 from razorunreal Modified Paths: -------------- code/gazebo/trunk/server/physics/Joint.cc code/gazebo/trunk/server/physics/Joint.hh Modified: code/gazebo/trunk/server/physics/Joint.cc =================================================================== --- code/gazebo/trunk/server/physics/Joint.cc 2008-08-20 22:19:04 UTC (rev 6966) +++ code/gazebo/trunk/server/physics/Joint.cc 2008-08-20 22:26:19 UTC (rev 6967) @@ -43,6 +43,7 @@ this->nameP = new Param<std::string>("name","",1); this->erpP = new Param<double>("erp",0.4,0); this->cfmP = new Param<double>("cfm",0.8,0); + this->suspensionCfmP = new Param<double>("suspensionCfm",0.0,0); this->body1NameP = new Param<std::string>("body1",std::string(),1); this->body2NameP = new Param<std::string>("body2",std::string(),1); this->anchorBodyNameP = new Param<std::string>("anchor",std::string(),0); @@ -58,6 +59,7 @@ delete this->nameP; delete this->erpP; delete this->cfmP; + delete this->suspensionCfmP; delete this->body1NameP; delete this->body2NameP; delete this->anchorBodyNameP; @@ -114,7 +116,8 @@ // Set joint parameters this->SetParam(dParamSuspensionERP, **(this->erpP)); - this->SetParam(dParamSuspensionCFM, **(this->erpP)); + this->SetParam(dParamSuspensionCFM, **(this->suspensionCfmP)); + this->SetParam(dParamCFM, **(this->cfmP)); /// Add a renderable for the joint this->visual = new OgreVisual(this->model->GetVisualNode()); @@ -160,6 +163,7 @@ stream << prefix << " " << *(this->erpP) << "\n"; stream << prefix << " " << *(this->cfmP) << "\n"; + stream << prefix << " " << *(this->suspensionCfmP) << "\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-08-20 22:19:04 UTC (rev 6966) +++ code/gazebo/trunk/server/physics/Joint.hh 2008-08-20 22:26:19 UTC (rev 6967) @@ -153,6 +153,7 @@ private: Param<std::string> *nameP; private: Param<double> *erpP; private: Param<double> *cfmP; + private: Param<double> *suspensionCfmP; private: Param<std::string> *body1NameP; private: Param<std::string> *body2NameP; private: Param<std::string> *anchorBodyNameP; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2008-08-22 11:19:34
|
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. |
From: <na...@us...> - 2008-09-24 18:06:41
|
Revision: 7039 http://playerstage.svn.sourceforge.net/playerstage/?rev=7039&view=rev Author: natepak Date: 2008-09-24 18:06:29 +0000 (Wed, 24 Sep 2008) Log Message: ----------- add svn properties Modified Paths: -------------- code/gazebo/trunk/server/physics/MapGeom.cc code/gazebo/trunk/server/physics/MapGeom.hh Property Changed: ---------------- code/gazebo/trunk/server/physics/ code/gazebo/trunk/server/physics/BallJoint.cc code/gazebo/trunk/server/physics/BallJoint.hh code/gazebo/trunk/server/physics/Body.cc code/gazebo/trunk/server/physics/Body.hh code/gazebo/trunk/server/physics/BoxGeom.cc code/gazebo/trunk/server/physics/BoxGeom.hh code/gazebo/trunk/server/physics/ContactParams.cc code/gazebo/trunk/server/physics/ContactParams.hh code/gazebo/trunk/server/physics/CylinderGeom.cc code/gazebo/trunk/server/physics/CylinderGeom.hh code/gazebo/trunk/server/physics/Geom.cc code/gazebo/trunk/server/physics/Geom.hh code/gazebo/trunk/server/physics/HeightmapGeom.cc code/gazebo/trunk/server/physics/HeightmapGeom.hh code/gazebo/trunk/server/physics/Hinge2Joint.cc code/gazebo/trunk/server/physics/Hinge2Joint.hh code/gazebo/trunk/server/physics/HingeJoint.cc code/gazebo/trunk/server/physics/HingeJoint.hh code/gazebo/trunk/server/physics/Joint.cc code/gazebo/trunk/server/physics/Joint.hh code/gazebo/trunk/server/physics/MapGeom.cc code/gazebo/trunk/server/physics/MapGeom.hh code/gazebo/trunk/server/physics/PhysicsEngine.cc code/gazebo/trunk/server/physics/PhysicsEngine.hh code/gazebo/trunk/server/physics/PlaneGeom.cc code/gazebo/trunk/server/physics/PlaneGeom.hh code/gazebo/trunk/server/physics/RayGeom.cc code/gazebo/trunk/server/physics/RayGeom.hh code/gazebo/trunk/server/physics/SliderJoint.cc code/gazebo/trunk/server/physics/SliderJoint.hh code/gazebo/trunk/server/physics/SphereGeom.cc code/gazebo/trunk/server/physics/SphereGeom.hh code/gazebo/trunk/server/physics/TrimeshGeom.cc code/gazebo/trunk/server/physics/TrimeshGeom.hh code/gazebo/trunk/server/physics/UniversalJoint.cc code/gazebo/trunk/server/physics/UniversalJoint.hh code/gazebo/trunk/server/physics/ode/ code/gazebo/trunk/server/physics/ode/ODEPhysics.cc code/gazebo/trunk/server/physics/ode/ODEPhysics.hh code/gazebo/trunk/server/physics/physim/ Property changes on: code/gazebo/trunk/server/physics ___________________________________________________________________ Modified: svn:ignore - *.os + .player *.os *.so *.o *.a config.log .scon* Ogre.log gazebo Doxyfile gazeborc *.pc .settings .cproject .project bandit Property changes on: code/gazebo/trunk/server/physics/BallJoint.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/BallJoint.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/Body.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/Body.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/BoxGeom.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/BoxGeom.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/ContactParams.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/ContactParams.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/CylinderGeom.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/CylinderGeom.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/Geom.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/Geom.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/HeightmapGeom.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/HeightmapGeom.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/Hinge2Joint.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/Hinge2Joint.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/HingeJoint.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/HingeJoint.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/Joint.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/Joint.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Modified: code/gazebo/trunk/server/physics/MapGeom.cc =================================================================== --- code/gazebo/trunk/server/physics/MapGeom.cc 2008-09-24 18:04:30 UTC (rev 7038) +++ code/gazebo/trunk/server/physics/MapGeom.cc 2008-09-24 18:06:29 UTC (rev 7039) @@ -21,7 +21,7 @@ /* Desc: Map geometry * Author: Nate Koenig * Date: 14 July 2008 - * CVS: $Id:$ + * CVS: $Id$ */ #include <ode/ode.h> Property changes on: code/gazebo/trunk/server/physics/MapGeom.cc ___________________________________________________________________ Added: svn:keywords + Id Revision Modified: code/gazebo/trunk/server/physics/MapGeom.hh =================================================================== --- code/gazebo/trunk/server/physics/MapGeom.hh 2008-09-24 18:04:30 UTC (rev 7038) +++ code/gazebo/trunk/server/physics/MapGeom.hh 2008-09-24 18:06:29 UTC (rev 7039) @@ -21,7 +21,7 @@ /* Desc: Occupancy grid geom * Author: Nate Koenig * Date: 14 Jly 2008 - * CVS: $Id:$ + * CVS: $Id$ */ #ifndef MAPGEOM_HH Property changes on: code/gazebo/trunk/server/physics/MapGeom.hh ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: code/gazebo/trunk/server/physics/PhysicsEngine.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/PhysicsEngine.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/PlaneGeom.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/PlaneGeom.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/RayGeom.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/RayGeom.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/SliderJoint.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/SliderJoint.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/SphereGeom.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/SphereGeom.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/TrimeshGeom.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/TrimeshGeom.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/UniversalJoint.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/UniversalJoint.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/ode ___________________________________________________________________ Modified: svn:ignore - *.os + .player *.os *.so *.o *.a config.log .scon* Ogre.log gazebo Doxyfile gazeborc *.pc .settings .cproject .project bandit Property changes on: code/gazebo/trunk/server/physics/ode/ODEPhysics.cc ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/ode/ODEPhysics.hh ___________________________________________________________________ Modified: svn:keywords - Id + Id Revision Property changes on: code/gazebo/trunk/server/physics/physim ___________________________________________________________________ Added: svn:ignore + .player *.os *.so *.o *.a config.log .scon* Ogre.log gazebo Doxyfile gazeborc *.pc .settings .cproject .project bandit This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2008-11-12 19:38:17
|
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. |
From: <na...@us...> - 2008-11-27 16:37:11
|
Revision: 7180 http://playerstage.svn.sourceforge.net/playerstage/?rev=7180&view=rev Author: natepak Date: 2008-11-27 16:37:06 +0000 (Thu, 27 Nov 2008) Log Message: ----------- Added patch 2281269 Modified Paths: -------------- code/gazebo/trunk/server/physics/Body.cc code/gazebo/trunk/server/physics/Body.hh Modified: code/gazebo/trunk/server/physics/Body.cc =================================================================== --- code/gazebo/trunk/server/physics/Body.cc 2008-11-27 16:30:16 UTC (rev 7179) +++ code/gazebo/trunk/server/physics/Body.cc 2008-11-27 16:37:06 UTC (rev 7180) @@ -70,6 +70,9 @@ this->rpyP = new ParamT<Quatern>("rpy", Quatern(), 0); this->rpyP->Callback( &Body::SetRotation, this ); + + this->dampingFactorP = new ParamT<double>("dampingFactor", 0.03, 0); + Param::End(); } @@ -95,6 +98,7 @@ delete this->xyzP; delete this->rpyP; + delete this->dampingFactorP; } @@ -107,6 +111,7 @@ this->nameP->Load(node); this->xyzP->Load(node); this->rpyP->Load(node); + this->dampingFactorP->Load(node); Pose3d initPose; initPose.pos = **(this->xyzP); @@ -217,7 +222,11 @@ { std::vector< Sensor* >::iterator sensorIter; std::map< std::string, Geom* >::iterator geomIter; + Vector3 vel; + Vector3 avel; + double force; + this->UpdatePose(); if (!this->IsStatic()) @@ -237,6 +246,17 @@ { (*sensorIter)->Update(); } + + if(this->GetId()) + { + force = this->dampingFactorP->GetValue() * this->mass.mass; + vel = this->GetLinearVel(); + dBodyAddForce(this->GetId(), -((vel.x * fabs(vel.x)) * force), -((vel.y * fabs(vel.y)) * force), -((vel.z * fabs(vel.z)) * force)); + + avel = this->GetAngularVel(); + dBodyAddTorque(this->GetId(), -avel.x * force, -avel.y * force, -avel.z * force); + } + } //////////////////////////////////////////////////////////////////////////////// @@ -280,7 +300,7 @@ //this->SetPosition(this->staticPose.pos); //this->SetRotation(this->staticPose.rot); - + for (iter = this->geoms.begin(); iter != this->geoms.end(); iter++) { //newPose = (*iter)->GetPose() - this->staticPose; @@ -702,7 +722,7 @@ { return dynamic_cast<Model*>(this->GetParent()); } - + //////////////////////////////////////////////////////////////////////////////// /// Get a geom by name Geom *Body::GetGeom(const std::string &name) const @@ -719,4 +739,4 @@ return NULL; } } - + Modified: code/gazebo/trunk/server/physics/Body.hh =================================================================== --- code/gazebo/trunk/server/physics/Body.hh 2008-11-27 16:30:16 UTC (rev 7179) +++ code/gazebo/trunk/server/physics/Body.hh 2008-11-27 16:37:06 UTC (rev 7180) @@ -1,6 +1,6 @@ /* * Gazebo - Outdoor Multi-Robot Simulator - * Copyright (C) 2003 + * Copyright (C) 2003 * Nate Koenig & Andrew Howard * * This program is free software; you can redistribute it and/or modify @@ -47,97 +47,97 @@ /// \addtogroup gazebo_physics /// \brief The body class /// \{ - + /// Body class class Body : public Entity { /// \brief Constructor public: Body(Entity *parent, dWorldID worldId); - + /// \brief Destructor public: virtual ~Body(); - + /// \brief Load the body based on an XMLConfig node /// \param node XMLConfigNode pointer public: virtual void Load(XMLConfigNode *node); - + /// \brief Save the body based on our XMLConfig node public: virtual void Save(std::string &prefix, std::ostream &stream); - + /// \brief Initialize the body public: virtual void Init(); - + /// \brief Finalize the body public: void Fini(); - + /// \brief Update the body public: virtual void Update(); - + /// \brief Attach a geom to this body /// \param geom Geometery to attach to this body public: void AttachGeom( Geom *geom ); - + /// \brief Set the pose of the body /// \param pose New pose of the body public: void SetPose(const Pose3d &pose); - + /// \brief Return the pose of the body /// \return Pose of the body public: Pose3d GetPose() const; - + /// \brief Set the position of the body /// \param pos Vector position public: void SetPosition(const Vector3 &pos); - + /// \brief Set the rotation of the body /// \param rot Quaternion rotation public: void SetRotation(const Quatern &rot); - + /// \brief Return the position of the body /// \return Position vector public: Vector3 GetPosition() const; - + /// \brief Return the rotation /// \return Rotation quaternion public: Quatern GetRotation() const; - + /// \brief Return the ID of this body /// \return ODE body id public: dBodyID GetId() const; - + /// \brief Set whether this body is enabled public: void SetEnabled(bool enable) const; - + /// \brief Update the center of mass public: void UpdateCoM(); - + /// \brief Get the Center of Mass pose public: const Pose3d &GetCoMPose() const; - + /// \brief Set whether gravity affects this body public: void SetGravityMode(bool mode); - + /// \brief Set the linear velocity of the body public: void SetLinearVel(const Vector3 &vel); - + /// \brief Get the linear velocity of the body public: Vector3 GetLinearVel() const; - + /// \brief Set the angular velocity of the body public: void SetAngularVel(const Vector3 &vel); - + /// \brief Get the angular velocity of the body public: Vector3 GetAngularVel() const; - + /// \brief Set the force applied to the body public: void SetForce(const Vector3 &force); - + /// \brief Get the force applied to the body public: Vector3 GetForce() const; - + /// \brief Set the torque applied to the body public: void SetTorque(const Vector3 &force); - + /// \brief Get the torque applied to the body public: Vector3 GetTorque() const; @@ -149,43 +149,48 @@ /// \brief Get the model that this body belongs to public: Model *GetModel() const; - + + /// \brief Get the mass of the body + public: float GetMass() { return mass.mass; } + /// Load a new geom helper function /// \param node XMLConfigNode used to load the geom private: void LoadGeom(XMLConfigNode *node); - + /// Load a new sensor /// \param node XMLConfigNode used to load the geom private: void LoadSensor(XMLConfigNode *node); - + /// \brief Load a renderable private: void LoadVisual(XMLConfigNode *node); /// \brief Update the pose of the body private: void UpdatePose(); - + /// List of geometries attached to this body private: std::map< std::string, Geom* > geoms; - + /// List of attached sensors private: std::vector< Sensor* > sensors; - + /// ODE body handle private: dBodyID bodyId; - + /// Mass properties of the object private: dMass mass; - + private: bool isStatic; - + private: Pose3d comPose; private: Pose3d staticPose; private: Pose3d pose; - + private: ParamT<Vector3> *xyzP; private: ParamT<Quatern> *rpyP; + + private: ParamT<double> *dampingFactorP; }; - + /// \} } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hsu...@us...> - 2009-05-14 18:44:56
|
Revision: 7664 http://playerstage.svn.sourceforge.net/playerstage/?rev=7664&view=rev Author: hsujohnhsu Date: 2009-05-14 18:44:51 +0000 (Thu, 14 May 2009) Log Message: ----------- return list of sensors for the Body. Modified Paths: -------------- code/gazebo/trunk/server/physics/Body.cc code/gazebo/trunk/server/physics/Body.hh Modified: code/gazebo/trunk/server/physics/Body.cc =================================================================== --- code/gazebo/trunk/server/physics/Body.cc 2009-05-14 16:41:37 UTC (rev 7663) +++ code/gazebo/trunk/server/physics/Body.cc 2009-05-14 18:44:51 UTC (rev 7664) @@ -1253,3 +1253,10 @@ else return NULL; } + +//////////////////////////////////////////////////////////////////////////////// +// Get all children +std::vector< Sensor* > &Body::GetSensors() +{ + return this->sensors; +} Modified: code/gazebo/trunk/server/physics/Body.hh =================================================================== --- code/gazebo/trunk/server/physics/Body.hh 2009-05-14 16:41:37 UTC (rev 7663) +++ code/gazebo/trunk/server/physics/Body.hh 2009-05-14 18:44:51 UTC (rev 7664) @@ -206,6 +206,9 @@ /// \brief Set transparency for all child geometries public: void SetTransparency(float t); + /// Returns list of sensors + public: std::vector< Sensor* > &GetSensors(); + /// List of geometries attached to this body private: std::map< std::string, Geom* > geoms; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hsu...@us...> - 2009-05-16 00:53:48
|
Revision: 7679 http://playerstage.svn.sourceforge.net/playerstage/?rev=7679&view=rev Author: hsujohnhsu Date: 2009-05-16 00:53:46 +0000 (Sat, 16 May 2009) Log Message: ----------- fix initial Body Geom pose. fix custom mass initialization. Modified Paths: -------------- code/gazebo/trunk/server/physics/Body.cc code/gazebo/trunk/server/physics/Geom.cc Modified: code/gazebo/trunk/server/physics/Body.cc =================================================================== --- code/gazebo/trunk/server/physics/Body.cc 2009-05-15 20:25:07 UTC (rev 7678) +++ code/gazebo/trunk/server/physics/Body.cc 2009-05-16 00:53:46 UTC (rev 7679) @@ -932,7 +932,7 @@ this->ixx,this->iyy,this->izz, this->ixy,this->ixz,this->iyz); - dMassTranslate( &this->mass, -this->cx, -this->cy, -this->cz); + //dMassTranslate( &this->mass, -this->cx, -this->cy, -this->cz); // dMatrix3 rot; // dMassRotate(&this->mass, rot); Modified: code/gazebo/trunk/server/physics/Geom.cc =================================================================== --- code/gazebo/trunk/server/physics/Geom.cc 2009-05-15 20:25:07 UTC (rev 7678) +++ code/gazebo/trunk/server/physics/Geom.cc 2009-05-16 00:53:46 UTC (rev 7679) @@ -147,7 +147,7 @@ pose.rot = this->rpyP->GetValue(); // TODO: This should probably be true....but "true" breaks trimesh postions. - this->SetPose(pose, true); + this->SetPose(pose, false); childNode = node->GetChild("visual"); while (childNode) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-05-18 18:26:59
|
Revision: 7688 http://playerstage.svn.sourceforge.net/playerstage/?rev=7688&view=rev Author: natepak Date: 2009-05-18 18:26:48 +0000 (Mon, 18 May 2009) Log Message: ----------- Fixed drawing of joints Modified Paths: -------------- code/gazebo/trunk/server/physics/Geom.cc code/gazebo/trunk/server/physics/Joint.cc Modified: code/gazebo/trunk/server/physics/Geom.cc =================================================================== --- code/gazebo/trunk/server/physics/Geom.cc 2009-05-18 16:26:49 UTC (rev 7687) +++ code/gazebo/trunk/server/physics/Geom.cc 2009-05-18 18:26:48 UTC (rev 7688) @@ -529,7 +529,7 @@ { if (*iter) { - (*iter)->SetVisible(false, false); + (*iter)->SetVisible(true, false); (*iter)->SetTransparency(0.6); } } @@ -540,8 +540,8 @@ { if (*iter) { - (*iter)->SetVisible(true, false); - (*iter)->SetTransparency(1.0); + (*iter)->SetVisible(true, true); + (*iter)->SetTransparency(0.0); } } } Modified: code/gazebo/trunk/server/physics/Joint.cc =================================================================== --- code/gazebo/trunk/server/physics/Joint.cc 2009-05-18 16:26:49 UTC (rev 7687) +++ code/gazebo/trunk/server/physics/Joint.cc 2009-05-18 18:26:48 UTC (rev 7688) @@ -138,7 +138,7 @@ /// Add a renderable for the joint this->visual = OgreCreator::Instance()->CreateVisual( - visname.str(), this->model->GetVisualNode()); + visname.str(), NULL); if (this->visual) { this->visual->AttachMesh("joint_anchor"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2009-06-03 14:12:21
|
Revision: 7774 http://playerstage.svn.sourceforge.net/playerstage/?rev=7774&view=rev Author: natepak Date: 2009-06-03 14:11:22 +0000 (Wed, 03 Jun 2009) Log Message: ----------- Added friction enable flag to ContactParams Modified Paths: -------------- code/gazebo/trunk/server/physics/ContactParams.cc code/gazebo/trunk/server/physics/ContactParams.hh code/gazebo/trunk/server/physics/Geom.cc code/gazebo/trunk/server/physics/ode/ODEPhysics.cc Modified: code/gazebo/trunk/server/physics/ContactParams.cc =================================================================== --- code/gazebo/trunk/server/physics/ContactParams.cc 2009-06-03 13:51:30 UTC (rev 7773) +++ code/gazebo/trunk/server/physics/ContactParams.cc 2009-06-03 14:11:22 UTC (rev 7774) @@ -52,6 +52,8 @@ this->mu2 = dInfinity; this->slip1 = 0.01; this->slip2 = 0.01; + + this->enableFriction = true; } ////////////////////////////////////////////////////////////////////////////// Modified: code/gazebo/trunk/server/physics/ContactParams.hh =================================================================== --- code/gazebo/trunk/server/physics/ContactParams.hh 2009-06-03 13:51:30 UTC (rev 7773) +++ code/gazebo/trunk/server/physics/ContactParams.hh 2009-06-03 14:11:22 UTC (rev 7774) @@ -78,6 +78,8 @@ /// \brief soft constraint force mixing public: double softCfm; + + public: bool enableFriction; public: boost::signal< void (Geom*, Geom*)> contactSignal; }; Modified: code/gazebo/trunk/server/physics/Geom.cc =================================================================== --- code/gazebo/trunk/server/physics/Geom.cc 2009-06-03 13:51:30 UTC (rev 7773) +++ code/gazebo/trunk/server/physics/Geom.cc 2009-06-03 14:11:22 UTC (rev 7774) @@ -636,20 +636,5 @@ /// Set the friction mode of the geom void Geom::SetFrictionMode( const bool &v ) { - if (v == false) - { - this->contact->mu1 = 0; - this->contact->mu2 = 0; - this->contact->slip1 = 0; - this->contact->slip2 = 0; - } - else - { - this->contact->mu1 = dInfinity; - this->contact->mu2 = dInfinity; - this->contact->slip1 = 0.1; - this->contact->slip2 = 0.1; - - } + this->contact->enableFriction = v; } - Modified: code/gazebo/trunk/server/physics/ode/ODEPhysics.cc =================================================================== --- code/gazebo/trunk/server/physics/ode/ODEPhysics.cc 2009-06-03 13:51:30 UTC (rev 7773) +++ code/gazebo/trunk/server/physics/ode/ODEPhysics.cc 2009-06-03 14:11:22 UTC (rev 7774) @@ -372,17 +372,29 @@ contact.surface.soft_erp = h * kp / (h * kp + kd); contact.surface.soft_cfm = 1.0 / (h * kp + kd); - contact.surface.mu = std::min(geom1->contact->mu1, geom2->contact->mu1); - contact.surface.mu2 = std::min(geom1->contact->mu2, geom2->contact->mu2); + if (geom1->contact->enableFriction && geom2->contact->enableFriction) + { + contact.surface.mu = std::min(geom1->contact->mu1, + geom2->contact->mu1); + contact.surface.mu2 = std::min(geom1->contact->mu2, + geom2->contact->mu2); + contact.surface.slip1 = std::min(geom1->contact->slip1, + geom2->contact->slip1); + contact.surface.slip2 = std::min(geom1->contact->slip2, + geom2->contact->slip2); + } + else + { + contact.surface.mu = 0; + contact.surface.mu2 = 0; + contact.surface.slip1 = 0.1; + contact.surface.slip2 = 0.1; + } + contact.surface.bounce = std::min(geom1->contact->bounce, geom2->contact->bounce); contact.surface.bounce_vel = std::min(geom1->contact->bounceVel, geom2->contact->bounceVel); - contact.surface.slip1 = std::min(geom1->contact->slip1, - geom2->contact->slip1); - contact.surface.slip2 = std::min(geom1->contact->slip2, - geom2->contact->slip2); - dJointID c = dJointCreateContact (self->worldId, self->contactGroup, &contact); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |