第一步:
点击链接:http://petercorke.com/wordpress/toolboxes/robotics-toolbox
第二步:
点击:Install from zip file里面的RBT-9.10.zip(October 1,2017)或者其余三个zip文件,下载到指定的文件夹里面,解压~~
第三步:
将上一步解压完毕的zip文件中的rvctools文件复制到matlab的文件夹的toolbox内。
第四步:
在matlab界面的主页下面的“设置路径”,点击添加文件,之后将第三步的rvctools文件选中,保存一下。
设置完成记着保存~~
第五步:
在命令行窗口
输入startup_rvc,当显示一连串字符就说明完成安装
第五步:测试代码
clear;
clc;
L1 = Link('d', 0, 'a', 0, 'alpha', pi/2); %Link 类函数
L2 = Link('d', 0, 'a', 0.5, 'alpha', 0,'offset',pi/2);
L3 = Link('d', 0, 'a', 0, 'alpha', pi/2,'offset',pi/4);
L4 = Link('d', 1, 'a', 0, 'alpha', -pi/2);
L5 = Link('d', 0, 'a', 0, 'alpha', pi/2);
L6 = Link('d', 1, 'a', 0, 'alpha', 0);
robot=SerialLink([L1,L2,L3,L4,L5,L6]); %SerialLink 类函数
robot.name='带球形腕的拟人臂'; %SerialLink 属性值
%robot.manuf='飘零过客'; %SerialLink 属性值
init_ang=[0 0 0 0 0 0];
targ_ang=[pi/4,-pi/3,pi/5,pi/2,-pi/4,pi/6];
step=40;
[q,qd,qdd] = jtraj(init_ang, targ_ang, step);
subplot(3,2,[1,3]);
robot.plot(q);
subplot(3,2,2);
i=1:6;
plot(q(:,i));
title('位置');
grid on;
subplot(3,2,4);
i=1:6;
plot(qd(:,i));
title('速度');
grid on;
subplot(3,2,6);
i=1:6;
plot(qdd(:,i));
title('加速度');
grid on;
p1 =[ -0.7071 -0.0000 0.7071 1.4142;
0.0000 -1.0000 -0.0000 -0.0000;
0.7071 0.0000 0.7071 1.9142;
0 0 0 1.0000];
p2 =[ 0.9640 -0.2639 -0.0332 0.9331;
0.0979 0.2361 0.9668 1.9331;
-0.2473 -0.9352 0.2534 0.8618;
0 0 0 1.0000];
Tc=ctraj(p1,p2,step);
Tjtraj=transl(Tc);
subplot(3,2,5);
plot2(Tjtraj,'r');
title('p1到p2直线轨迹');
grid on;
机器人工具箱就添加完成了!!
参考文献
【1】https://blog.youkuaiyun.com/zyf1109/article/details/53423385
【2】https://zhidao.baidu.com/question/1824137153186684588.html
【3】https://blog.youkuaiyun.com/xuehuafeiwu123/article/details/52672892