-
開發日誌
-
pypot使用方法
-
討論
-
開發日誌 ===
實作部分
-步驟一
製作一個.ttt,必須要組裝好而且要進行組立完成
-步驟二
在Vrep裡面的環境設定部份加上一個child script,Non-threaded child script進行程式碼的溝通,這個部分主要把pypot和vrep進行溝通,不需要額外設定別的馬達。
程式碼如下
(註記: lua brush 名稱要使用小寫)
-- DO NOT WRITE CODE OUTSIDE OF THE if-then-end SECTIONS BELOW!!
if (sim_call_type==sim_childscriptcall_initialization) then
simSetScriptAttribute(sim_handle_self,sim_childscriptattribute_automaticcascadingcalls,false)
end
if (sim_call_type==sim_childscriptcall_actuation) then
if not firstTimeHere93846738 then
firstTimeHere93846738=0
end
simSetScriptAttribute(sim_handle_self,sim_scriptattribute_executioncount,firstTimeHere93846738)
firstTimeHere93846738=firstTimeHere93846738+1
------------------------------------------------------------------------------
-- Check the end of the script for some explanations!
if (simGetScriptExecutionCount()==0) then
end
simHandleChildScripts(sim_call_type)
local currentTime=simGetSimulationTime()
simSetFloatSignal('CurrentTime',currentTime)
end
if (sim_call_type==sim_childscriptcall_sensing) then
simHandleChildScripts(sim_call_type)
end
if (sim_call_type==sim_childscriptcall_cleanup) then
-- Put some restoration code here
end
-步驟三
製作一份每個軸(joint)上面馬達的json格式檔,這邊的馬達選用基本上都是使用dynamixel motors公司所販售的,這間公司的馬達每顆都含有力回饋、熱回饋、等多種感測器在馬達上面。
json格式表,可以設定的部分
- 控制器(controller)
- 連線方式(串列通訊方式) 這邊還要看可不可以改成Arduino來使用
- 是否要同步運作(sync)可以連同模擬器一起進行real time控制
- 設定馬達群組(Group)
- 針對每顆馬達設計它的極限角度以及型號
{
"controllers": {
"my_dxl_controller": {
"sync_read": true,
"protocol": 2,
"attached_motors": [
"base"
],
"port": "/dev/ttyAMA0",
"syncloop": "LightDxlController"
}
},
"motorgroups": {
"base": [
"m1"
]
},
"motors": {
"m1": {
"offset": 0.0,
"type": "XL-320",
"id": 1,
"angle_limit": [
-90.0,
90.0
],
"orientation": "direct"
}
}
}
-步驟四
這部分可以使用我寫好的小外掛來做,下載我倉儲系統裡面的小型外掛,可以利用圖形化介面進行Vrep內部的控制,還有一些會凍結畫面的小BUG,我再進行處理,已經可以使用自訂的方法進行內部Vrep控制。
-討論部分
1.實體同步控制部分還在想要怎麼進行測試,光是控制器的選用或馬達選用,這邊都有待討論,還在和開發的相關人員問是否可以使用Arduino之類的控制器進行控制,這部分要等待他們回覆。
2.因為沒有實體部分可以進行測試,只能用Vrep內部的機器,在群組馬達的部分我還是不太理解他是怎麼區分的,範例檔裡面的那隻poppy因為太過複雜,無法理解他是如何定義他的馬達群組方法。
3.目前我都還無法控制由我們自己組裝的機器,像是最簡單的單軸選轉的部分,我沒辦法使用他的lib進行Vrep內部的模擬,這邊可能是我們組的方法有錯或者是內部那根軸影響到實際模擬,這邊還需要討論。
Comments
comments powered by Disqus