stage3-ag5

  • Home
    • Site Map
    • reveal
    • blog
  • Introduction
  • Stage1,2
    • stage1
      • stage2
  • week
    • w10
      • task1
      • task2
      • task3
    • w11
      • task3-1
    • w12
    • w13
    • w14
    • w15
    • w16
    • w18
  • FINAL
    • 40823124
    • 40823128
    • 40823120
    • 40823115
    • 40823140
    • 40823139
    • 40823111
40823139 << Previous

40823111

stage3-ag5 資料統整

這物專案我們是以組員40823139 來改良為主,我們和stage2不同的是把原本複雜的程式縮減成用dummy只要控制 可以大大減少coppliasim 的複雜度

場景下載 Stage3-ag1-module.ttt (場景提供 組員40823139)

解說

改良後 最終成品

這物專案我們是以組員40823139 來改良為主,我們和stage2不同的是把原本複雜的程式縮減成用dummy只要控制 可以大大減少coppliasim 的複雜度

改良前 (原本有很多複雜的程式)

改良後 (我們把它用dummy取代)

手臂程式

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

function sysCall_threadmain()

    jointHandles={-1,-1,-1,-1,-1,-1}
    for i=1,6,1 do
        jointHandles[i]=sim.getObjectHandle('UR3_joint'..i)
    end
    
    while sim.getSimulationState()~=sim.simulation_advancing_abouttostop do


    -- Set-up some of the RML vectors:
    vel=10000 --velocity
    accel=1000--acceleration
    jerk=0
    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={150*math.pi/180,108*math.pi/180,-90*math.pi/180,90*math.pi/180,90*math.pi/180,90*math.pi/180}
    sim.rmlMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos1,targetVel)

    targetPos2={-90*math.pi/180,99*math.pi/180,-30*math.pi/360,-150*math.pi/180,-60*math.pi/180,90*math.pi/180}
    sim.rmlMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos2,targetVel)
    
    targetPos3={0,0,0,0,0,0}
    sim.rmlMoveToJointPositions(jointHandles,-1,currentVel,currentAccel,maxVel,maxAccel,maxJerk,targetPos3,targetVel)
    end

end


心得 << Previous

Copyright © All rights reserved | This template is made with by Colorlib


40823139 << Previous

Copyright © All rights reserved | This template is made with by Colorlib