代码拉取完成,页面将自动刷新
同步操作将从 雪落96/Analyzation_and_Simulation_of-Robotic-arm-in-Matlab-and-Vrep 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
function gripper (clientID,closing,j1,j2)
vrep=remApi('remoteApi');
[r,p1]=vrep.simxGetJointPosition(clientID,j1,vrep.simx_opmode_blocking);
[r,p2]=vrep.simxGetJointPosition(clientID,j2,vrep.simx_opmode_blocking);
if(closing==1)
if (p1 <(p2-0.008))
vrep.simxSetJointForce(clientID,j1,10,vrep.simx_opmode_blocking);
vrep.simxSetJointForce(clientID,j2,10,vrep.simx_opmode_blocking);
vrep.simxSetJointTargetVelocity (clientID,j1,-0.01,vrep.simx_opmode_blocking);
vrep.simxSetJointTargetVelocity (clientID,j2,-0.04,vrep.simx_opmode_blocking);
else
vrep.simxSetJointForce(clientID,j1,10,vrep.simx_opmode_blocking);
vrep.simxSetJointForce(clientID,j2,10,vrep.simx_opmode_blocking);
vrep.simxSetJointTargetVelocity (clientID,j1,-0.04,vrep.simx_opmode_blocking);
vrep.simxSetJointTargetVelocity (clientID,j2,-0.04,vrep.simx_opmode_blocking);
end
else
if(p1<p2)
vrep.simxSetJointForce(clientID,j1,10,vrep.simx_opmode_blocking);
vrep.simxSetJointForce(clientID,j2,10,vrep.simx_opmode_blocking);
vrep.simxSetJointTargetVelocity (clientID,j1,0.04,vrep.simx_opmode_blocking);
vrep.simxSetJointTargetVelocity (clientID,j2,0.02,vrep.simx_opmode_blocking);
else
vrep.simxSetJointForce(clientID,j1,10,vrep.simx_opmode_blocking);
vrep.simxSetJointForce(clientID,j2,10,vrep.simx_opmode_blocking);
vrep.simxSetJointTargetVelocity (clientID,j1,0.02,vrep.simx_opmode_blocking);
vrep.simxSetJointTargetVelocity (clientID,j2,0.04,vrep.simx_opmode_blocking);
end
end
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。