bool SimoxRobotViewer::setJointLimits( const std::string &robotNodeSet, std::vector<float> &min, std::vector<float> &max ) { if (!robot) { VR_ERROR << "No robot..." << endl; return false; } lock(); RobotNodeSetPtr rns = robot->getRobotNodeSet(robotNodeSet); if (!rns) { VR_ERROR << "No robot node set with name " << robotNodeSet << endl; unlock(); return false; } if (rns->getSize()!=min.size() || rns->getSize()!=max.size()) { VR_ERROR << "Wrong sizes. RNS (" << robotNodeSet << ") : " << rns->getSize() <<", minSize:" << min.size() << ", maxSize:" << max.size() << endl; unlock(); return false; } for (size_t i=0;i<min.size();i++) { RobotNodePtr rn = rns->getNode(i); if (!rn) return false; rn->setJointLimits(min[i],max[i]); } unlock(); return true; }
bool SimoxRobotViewer::setJointLimit( const std::string &robotNode, float min, float max ) { if (!robot) { VR_ERROR << "No robot..." << endl; return false; } lock(); RobotNodePtr rn = robot->getRobotNode(robotNode); if (!rn) { VR_ERROR << "No robot node with name " << robotNode << endl; unlock(); return false; } rn->setJointLimits(min,max); unlock(); return true; }