Final Project <<
Previous 期末考試
Solidwork 檔案下載:按這裡
Inventor 檔案下載:按這裡
40923221_final.zip
繪圖過程
meArm Robot.ttt:按這裡
UI內容(上下的移動因為頭太重,下去太多會抬不起來,所以角度有減少)
function closeEventHandler(h)
sim.addLog(sim.verbosity_scriptinfos,'Window '..h..' is closing...')
simUI.hide(h)
end
function joint1_rotate(ui,id,newVal)
simUI.setLabelText(ui,3000,'theta1 set to '..newVal)
sim.setJointTargetPosition(joint1, newVal*deg)
end
function joint2_rotate(ui,id,newVal)
simUI.setLabelText(ui,3000,'theta2 set to '..newVal)
sim.setJointTargetPosition(joint2, newVal*deg)
end
function joint3_rotate(ui,id,newVal)
simUI.setLabelText(ui,3000,'theta3 set to '..newVal)
sim.setJointTargetPosition(joint3, newVal*deg)
end
function joint16_rotate(ui,id,newVal)
simUI.setLabelText(ui,3000,'theta16 set to '..newVal)
sim.setJointTargetPosition(joint16, newVal*deg)
end
function sysCall_init()
-- do some initialization here
joint1 = sim.getObjectHandle('one')
joint2 = sim.getObjectHandle('two')
joint3 = sim.getObjectHandle('three')
joint16 = sim.getObjectHandle('four')
i = 0
deg = math.pi/180
print(i)
xml = [[
<ui closeable="true" on-close="closeEventHandler" resizable="true">
<label text="This is a demo of the CustomUI plugin. Browse through the tabs below to explore all the widgets that can be created with the plugin." wordwrap="true" />
<tabs>
<tab title="Numeric">a
<label text="Sliders can be oriented horizontally or vertically, and have optional properties that can be set (in the XML) such as minimum and maximum value." wordwrap="true" />
<label text="" id="3000" wordwrap="true" />
<label text="roll" /> <hslider tick-position="above" tick-interval="1"
minimum="-180" maximum="180" on-change="joint1_rotate" />
<label text="high" /> <hslider tick-position="above" tick-interval="1"
minimum="-30" maximum="65" on-change="joint2_rotate" />
<label text="head" /> <hslider tick-position="above" tick-interval="1"
minimum="-35" maximum="25" on-change="joint3_rotate" />
<label text="Paw" /> <hslider tick-position="above" tick-interval="1"
minimum="0" maximum="15" on-change="joint16_rotate" />
</tab>
</tabs>
</ui>
]]
ui=simUI.create(xml)
end
心得:過程中遇到很多的問題,像是原本想使用coppeliasim直接做旋轉,但是因為孔位的問題所以沒有對正,後面選擇使用SOLIDWORK的組合圖將其完成,而UI使用先前的UI進行修改完成。
Final Project <<
Previous