機器人工程師進階之路:matlab-robotics-toolbox安裝方法
Matlab中關於機器人的應用程式還是蠻多的。Peter為了方便教學和研發,他和他的團隊開發了Robotics Toolbox這麼一個工具箱。
工具箱介紹和安裝方法都在下面這個連結中可以找到
https://
petercorke。com/toolboxe
s/robotics-toolbox/
官方給了三種安裝方法,個人選擇其中一個比較方便的方式介紹給大家,以便大家快速安裝。
1)下載軟體包。
進入官方主頁,往下翻到Install from 。mltbx file介紹部分,點選下方連結下載RTB10。4。mltbx。(本文寫在2020年5月。官方主頁有時會變,軟體也可能會更新,只要找到mltbx檔案下載下來就好)
2)安裝。
將下載好的RTB10。4。mltbx移動到matlab的工作資料夾下。開啟matlab,在matlab瀏覽器找到安裝包,雙擊開啟。選擇合適的資料夾進行安裝。
3)嘗試使用。
在matlab命令視窗,執行命令。
>> rtbdemo
安裝完成!
4)DH法6軸模型顯示例程
%機械臂為六自由度機械臂
clear
L
;
%角度轉換
du
=
pi
/
180
;
%度
radian
=
180
/
pi
;
%弧度
%關節長度
L1
=
4。324
;
L2
=
16
;
L3
=
2。35
;
L4
=
16。085
;
L5
=
14。675
;
q0
=
0
;
L0
=
0
;
%過渡關節
%% DH法建立模型,關節角,連桿偏移,連桿長度,連桿扭轉角,關節型別(0轉動,1移動)
L
(
1
)
=
Link
(
‘d’
,
L1
,
‘a’
,
0
,
‘alpha’
,
-
pi
/
2
,
‘offset’
,
0
);
L
(
2
)
=
Link
(
‘d’
,
0
,
‘a’
,
-
L2
,
‘alpha’
,
0
,
‘offset’
,
pi
/
2
);
L
(
3
)
=
Link
(
‘d’
,
0
,
‘a’
,
-
L3
,
‘alpha’
,
pi
/
2
,
‘offset’
,
0
);
L
(
4
)
=
Link
(
‘d’
,
L4
,
‘a’
,
0
,
‘alpha’
,
-
pi
/
2
,
‘offset’
,
0
);
L
(
5
)
=
Link
(
‘d’
,
0
,
‘a’
,
0
,
‘alpha’
,
pi
/
2
,
‘offset’
,
pi
/
2
);
L
(
6
)
=
Link
(
‘d’
,
L5
,
‘a’
,
0
,
‘alpha’
,
0
,
‘offset’
,
0
);
plotopt
=
{
‘noraise’
,
‘nowrist’
,
‘nojaxes’
,
‘delay’
,
0
};
tool_char
=[
1
0
0
0
;
0
1
0
0
;
0
0
1
0
;
0
0
0
1
];
six_link
=
SerialLink
(
L
,
‘name’
,
‘six link’
,
‘tool’
,
tool_char
);
%顯示機械臂
figure
(
1
)
hold
on
six_link
。
plot
([
0
0
0
0
0
0
],
plotopt
{:});
hold
off