您的位置:首页 > 其它

V-rep学习笔记:Reflexxes Motion Library 1

2017-01-24 13:46 495 查看
  V-REP中集成了在线运动轨迹生成库Reflexxes Motion Library Type IV,目前Reflexxes公司已经被谷歌收购。(The Reflexxes Motion Libraries provide instantaneous trajectory generation capabilities for motion control systems. Reflexxes Motion Library contains a set of On-Line Trajectory Generation (OTG) algorithms that are designed to control robots and mechanical systems.) Reflexxes的众多优点使其可以应用于机器人、数控机床和伺服驱动系统等领域。

-- This is a threaded script, and is just an example!

jointHandles={-1,-1,-1,-1,-1,-1}
for i=1,6,1 do
jointHandles[i]=simGetObjectHandle('UR5_joint'..i)
end

-- Set-up some of the RML vectors:
vel=180
accel=40
jerk=80
currentVel={0,0,0,0,0,0,0}
currentAccel={0,0,0,0,0,0,0}
maxVel={vel*math.pi/180,vel*math.pi/180,vel*math.pi/180,vel*math.pi/180,vel*math.pi/180,vel*math.pi/180}
maxAccel={accel*math.pi/180,accel*math.pi/180,accel*math.pi/180,accel*math.pi/180,accel*math.pi/180,accel*math.pi/180}
maxJerk={jerk*math.pi/180,jerk*math.pi/180,jerk*math.pi/180,jerk*math.pi/180,jerk*math.pi/180,jerk*math.pi/180}
targetVel={0,0,0,0,0,0}

targetPos1={90*math.pi/180,90*math.pi/180,-90*math.pi/180,90*math.pi/180,90*math.pi/180,90*math.pi/180}

-- simRMLMoveToJointPositions: Moves (actuates) several joints at the same time using the Reflexxes Motion Library.
-- This function can only be called from child scripts running in a thread
--[[
number result,table newPos,table newVel,table newAccel,number timeLeft=simRMLMoveToJointPositions(table jointHandles,
number flags,table currentVel,table currentAccel,table maxVel,
table maxAccel,table maxJerk,table targetPos,table targetVel,table direction)
--]]
simRMLMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos1,targetVel)

targetPos2={-90*math.pi/180,45*math.pi/180,90*math.pi/180,135*math.pi/180,90*math.pi/180,90*math.pi/180}
simRMLMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos2,targetVel)

targetPos3={0,0,0,0,0,0}
simRMLMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos3,targetVel)


View Code
  添加一个Graph记录基座转动关节的角位移,可以看出确实符合程序中的设置:0°→90°→-90°→0°



参考:

Reflexxes Motion Libraries Manual and Documentation

V-REP: Reflexxes Motion Library Demonstration
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: