Revision: 8383 http://playerstage.svn.sourceforge.net/playerstage/?rev=8383&view=rev Author: natepak Date: 2009-11-10 19:17:03 +0000 (Tue, 10 Nov 2009)
Log Message: ----------- Removed some cout's and added in contact feedback Modified Paths: -------------- code/gazebo/trunk/server/MeshManager.cc code/gazebo/trunk/server/Model.cc code/gazebo/trunk/server/STLLoader.cc code/gazebo/trunk/server/physics/Body.cc code/gazebo/trunk/server/physics/ode/ODEPhysics.cc code/gazebo/trunk/worlds/simpleshapes.world Modified: code/gazebo/trunk/server/MeshManager.cc =================================================================== --- code/gazebo/trunk/server/MeshManager.cc 2009-11-10 18:27:01 UTC (rev 8382) +++ code/gazebo/trunk/server/MeshManager.cc 2009-11-10 19:17:03 UTC (rev 8383) @@ -71,6 +71,7 @@ iter!=gazeboPaths.end(); ++iter) { fullname = (*iter)+"/Media/models/"+filename; + //std::cout << "FullName[" << fullname << "]\n"; if (stat(fullname.c_str(), &st) == 0) { found = true; Modified: code/gazebo/trunk/server/Model.cc =================================================================== --- code/gazebo/trunk/server/Model.cc 2009-11-10 18:27:01 UTC (rev 8382) +++ code/gazebo/trunk/server/Model.cc 2009-11-10 19:17:03 UTC (rev 8383) @@ -852,6 +852,7 @@ gzthrow( "can't have two joint with the same name"); this->joints.push_back( joint ); + } //////////////////////////////////////////////////////////////////////////////// Modified: code/gazebo/trunk/server/STLLoader.cc =================================================================== --- code/gazebo/trunk/server/STLLoader.cc 2009-11-10 18:27:01 UTC (rev 8382) +++ code/gazebo/trunk/server/STLLoader.cc 2009-11-10 19:17:03 UTC (rev 8383) @@ -32,8 +32,6 @@ FILE *file = fopen(filename.c_str(), "r"); - std::cout << "SLT Load\n"; - /*if (extension == "stl" || extension == "stla") this->ReadAscii(file, mesh); else if (extension == "stlb") Modified: code/gazebo/trunk/server/physics/Body.cc =================================================================== --- code/gazebo/trunk/server/physics/Body.cc 2009-11-10 18:27:01 UTC (rev 8382) +++ code/gazebo/trunk/server/physics/Body.cc 2009-11-10 19:17:03 UTC (rev 8383) @@ -369,7 +369,6 @@ this->cgVisual->AttachMesh("body_cg"); this->cgVisual->SetMaterial("Gazebo/Red"); this->cgVisual->SetCastShadows(false); - this->cgVisual->SetVisible(false); std::map< std::string, Geom* >::iterator giter; @@ -383,6 +382,7 @@ line->AddPoint(giter->second->GetRelativePose().pos); } + this->cgVisual->SetVisible(false); } } Modified: code/gazebo/trunk/server/physics/ode/ODEPhysics.cc =================================================================== --- code/gazebo/trunk/server/physics/ode/ODEPhysics.cc 2009-11-10 18:27:01 UTC (rev 8382) +++ code/gazebo/trunk/server/physics/ode/ODEPhysics.cc 2009-11-10 19:17:03 UTC (rev 8383) @@ -80,9 +80,8 @@ // If auto-disable is active, then user interaction with the joints // doesn't behave properly - /*dWorldSetAutoDisableFlag(this->worldId, 1); + dWorldSetAutoDisableFlag(this->worldId, 1); dWorldSetAutoDisableTime(this->worldId, 2.0); - */ Param::Begin(&this->parameters); this->globalCFMP = new ParamT<double>("cfm", 10e-5, 0); @@ -94,10 +93,10 @@ this->contactSurfaceLayerP = new ParamT<double>("contactSurfaceLayer", 0.01, 0); Param::End(); - //this->contactFeedbacks.resize(100); + this->contactFeedbacks.resize(100); // Reset the contact pointer - //this->contactFeedbackIter = this->contactFeedbacks.begin(); + this->contactFeedbackIter = this->contactFeedbacks.begin(); } @@ -204,7 +203,7 @@ // Process all the contacts, get the feedback info, and call the geom // callbacks - /*for (std::vector<ContactFeedback>::iterator iter = + for (std::vector<ContactFeedback>::iterator iter = this->contactFeedbacks.begin(); iter != this->contactFeedbackIter; iter++) { @@ -226,9 +225,7 @@ // Reset the contact pointer this->contactFeedbackIter = this->contactFeedbacks.begin(); - */ - //usleep(1000000); #ifdef TIMING double tmpT2 = Simulator::Instance()->GetWallTime(); std::cout << " Collision DT (" << tmpT2-tmpT1 << ")" << std::endl; @@ -237,49 +234,20 @@ //////////////////////////////////////////////////////////////////////////////// // Update the ODE engine -// void ODEPhysics::UpdatePhysics() -// { -// #ifdef TIMING -// double tmpT1 = Simulator::Instance()->GetWallTime(); -// #endif -// -// // Update the dynamical model -// if (this->quickStepP->GetValue()) -// dWorldQuickStep(this->worldId, this->stepTimeP->GetValue() ); -// else -// dWorldStep( this->worldId, this->stepTimeP->GetValue() ); -// -// #ifdef TIMING -// double tmpT3 = Simulator::Instance()->GetWallTime(); -// std::cout << " ODE step DT (" << tmpT3-tmpT1 << ")" << std::endl; -// //std::cout << " Physics Total DT (" << tmpT3-tmpT1 << ")" << std::endl; -// #endif -// -// // Very important to clear out the contact group -// dJointGroupEmpty( this->contactGroup ); -// -// } - -//////////////////////////////////////////////////////////////////////////////// -// Update the ODE engine void ODEPhysics::UpdatePhysics() { #ifdef TIMING double tmpT1 = Simulator::Instance()->GetWallTime(); #endif - this->LockMutex(); this->UpdateCollision(); - // Do collision detection; this will add contacts to the contact group - //dSpaceCollide( this->spaceId, this, CollisionCallback ); - - //usleep(1000000); #ifdef TIMING double tmpT2 = Simulator::Instance()->GetWallTime(); std::cout << " Collision DT (" << tmpT2-tmpT1 << ")" << std::endl; #endif + this->LockMutex(); // Update the dynamical model if (this->quickStepP->GetValue()) dWorldQuickStep(this->worldId, this->stepTimeP->GetValue() ); @@ -544,7 +512,7 @@ dJointID c = dJointCreateContact (self->worldId, self->contactGroup, &contact); - /*if (self->contactFeedbackIter == self->contactFeedbacks.end()) + if (self->contactFeedbackIter == self->contactFeedbacks.end()) { self->contactFeedbacks.resize( self->contactFeedbacks.size() + 100); fprintf(stderr, "Resize\n"); @@ -554,7 +522,6 @@ (*self->contactFeedbackIter).geom2 = geom2; dJointSetFeedback(c, &(*self->contactFeedbackIter).feedback); self->contactFeedbackIter++; - */ dJointAttach (c,b1,b2); } Modified: code/gazebo/trunk/worlds/simpleshapes.world =================================================================== --- code/gazebo/trunk/worlds/simpleshapes.world 2009-11-10 18:27:01 UTC (rev 8382) +++ code/gazebo/trunk/worlds/simpleshapes.world 2009-11-10 19:17:03 UTC (rev 8383) @@ -17,8 +17,13 @@ <physics:bullet> <stepTime>0.001</stepTime> <gravity>0 0 -9.8</gravity> - <cfm>10e-2</cfm> + <cfm>10e-10</cfm> <erp>0.2</erp> + <quickStep>true</quickStep> + <quickStepIters>50</quickStepIters> + <quickStepW>1.3</quickStepW> + <contactMaxCorrectingVel>100.0</contactMaxCorrectingVel> + <contactSurfaceLayer>0.001</contactSurfaceLayer> <!-- updateRate: <0 == throttle simTime to match realTime. 0 == No throttling This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit