LBR_iiwa_14_R820代码解析



-- This is a threaded script, and is just an example!
--rmlMoveToJointPositions 是一个阻塞函数 只有线程子脚本能够使用

function sysCall_threadmain()
    --Put some initialization code here:
    jointHandles={-1,-1,-1,-1,-1,-1,-1}
    for i=1,7,1 do
        jointHandles[i]=sim.getObjectHandle('LBR_iiwa_14_R820_joint'..i)
    end

    -- Set-up some of the RML vectors:
    vel=180   --速度
    accel=80  --加速度
    jerk=80   --加加速度
    currentVel={0,0,0,0,0,0,0}       --当前速度
    currentAccel={0,0,0,0,0,0,0}     --当前加速度
    --(*math.pi/180)的主要作用是转化成弧度制
    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,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,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,jerk*math.pi/180}
    --目标速度
    targetVel={0,0,0,0,0,0,0}
    --目标Pos1
    targetPos1={90*math.pi/180,90*math.pi/180,170*math.pi/180,-90*math.pi/180,90*math.pi/180,90*math.pi/180,0}
    -- Blocking functions (only available from threaded child scripts)
    -- 此函数Moves an object to a given position and/or orientation   移动到Pos1
    -- jointHandles为要驱动的关节 
    -- -1为默认值
    -- currentVel 当前速度可以用0速度向量来设置 currentAccel同理
    -- maxVel所允许的关节的最大速度  maxAccel,maxJerk 也是这样
    -- maxJerk是加加速度。加加速度,又称急动度,是描述加速度变化快慢的物理量。加加速度是由加速度的变化量和时间决定的
    -- targetPos  the desired target positions of the joints
    -- targetVe:the desired velocity of the joints at the target.可以用0向量
    sim.rmlMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos1,targetVel)

    targetPos2={-90*math.pi/180,90*math.pi/180,180*math.pi/180,-90*math.pi/180,90*math.pi/180,90*math.pi/180,0}
    --此函数Moves an object to a given position and/or orientation                             移动到Pos2
    sim.rmlMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos2,targetVel)

    targetPos3={0,0,0,40,0,0,0}                                                              --移动到Pos3
    sim.rmlMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos3,targetVel)
end
--rmlMoveToJointPositions 总而言之 移动一个物体或者说是对象到指定的位置或者方向  Moves an object to a given position and/or orientation
--Moves an object to a given position and/or orientation using the Reflexxes Motion Library type II or IV. 
--This function can only be called from child scripts running in a thread (since this is a blocking 
--operation) and is not available from the C-API. 
--可填参数


  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值