40823122

  • Home
    • Site Map
    • reveal
    • blog
  • stage1-ag13
    • w2
      • 網頁建立以及偕同修改
    • w3
      • 分組網站
      • 產品
    • w4
    • w5
  • stage2-ag7
    • w6
    • w7
      • 整合分組網頁
      • v-rep模擬
  • w8
  • stage3-ag6
    • w10
      • task1
      • task2
    • w13
    • w14
    • w15
      • MTB_robort
      • 字幕整理
    • w16
      • 成果
    • w17
      • 籃框移動控制
      • 程式
      • 導入w16的機械手臂
    • w18
w17 << Previous Next >> 程式

籃框移動控制

function sysCall_init()
    -- do some initialization here
     j=sim.getObjectHandle('slide') --定義籃框伸縮軸
     d = 0 --posion
     a=10 --定義a與b的基礎值方便底下程式運算
     b=0
     distance=0.001  --籃框的位移量
     --sim.sJointTargetVelocity(joint,5.5)
end
  
function sysCall_actuation()
      if (a==10) then --在a等於10的情況下
      d = d - distance  --對d原本為0的值持續改變座標
      sim.setJointPosition(j, d)--設定軸位置的語法(對應軸的代號/位置)
      end
      if(d<=-0.5)then  --如果軸的位置到達設定範圍
      a=0  --更改初始值
      b=10
      end
      if (b==10) then
      d = d + distance
      sim.setJointPosition(j, d)
      end
      if(d>=0.5)then
      a=10
      b=0
      end
      end 
function sysCall_sensing()
    -- put your sensing code here
end
  
function sysCall_cleanup()
    -- do some clean-up here
end
  
-- See the user manual or the available code snippets for additional callback functions and details


w17 << Previous Next >> 程式

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