int CBirrtProblem::CheckSelfCollision(ostream& sout, istream& sinput) { //lock mutex EnvironmentMutex::scoped_lock lockenv(GetEnv()->GetMutex()); if(robot->CheckSelfCollision()) sout << "1"; else sout << "0"; return true; }
bool QtOSGViewer::_ForceUpdatePublishedBodies() { { boost::mutex::scoped_lock lockupdating(_mutexUpdating); if( !_bUpdateEnvironment ) return false; } boost::mutex::scoped_lock lock(_mutexUpdateModels); EnvironmentMutex::scoped_lock lockenv(GetEnv()->GetMutex()); GetEnv()->UpdatePublishedBodies(); _bModelsUpdated = false; _bLockEnvironment = false; // notify UpdateFromModel to update without acquiring the lock _condUpdateModels.wait(lock); _bLockEnvironment = true; // reste return _bModelsUpdated; }
bool CBirrtProblem::DoGeneralIK(ostream& sout, istream& sinput) { //lock mutex EnvironmentMutex::scoped_lock lockenv(GetEnv()->GetMutex()); RAVELOG_DEBUG("Starting General IK...\n"); TransformMatrix tmtarg; TransformMatrix tmrobot; Transform Ttarg; Vector cogtarg; bool bExecute = false; bool bBalance = false; bool bGetTime = false; bool bReturnSolved = false; bool bNoRot = false; bool bReturnClosest = false; std::vector<string> supportlinks; std::vector<dReal> ikparams; std::vector<dReal> supportpolyx; std::vector<dReal> supportpolyy; dReal temp; string cmd; Vector polyscale(1.0,1.0,1.0); Vector polytrans(0,0,0); while(!sinput.eof()) { sinput >> cmd; if( !sinput ) break; if( stricmp(cmd.c_str(), "nummanips") == 0 ) { sinput >> temp; ikparams.push_back(temp); } else if( stricmp(cmd.c_str(), "exec") == 0 ) {