Matlab Robotic Toolbox工具箱学习笔记(3)

2019-04-14 16:32

clear; clc;

L1 = Link('d', 0, 'a', 0, 'alpha', -pi/2);%定义连杆 L2 = Link('d', 1, 'a', 0, 'alpha', pi/2); L3 = Link('theta', 0, 'a', 0, 'alpha', 0); L4 = Link('d', 0, 'a', 0, 'alpha', -pi/2); L5 = Link('d', 0, 'a', 0, 'alpha', pi/2); L6 = Link('d', 1, 'a', 0, 'alpha', 0);

bot = SerialLink([L1 L2 L3 L4 L5 L6]);%连接连杆 bot.display();%显示D-H参数表

forward_kinematics=bot.fkine([-0.2 0.1 10 0.1 1 2])%前向运动学

求出末端的齐次变换矩阵:

clear; clc;

L1 = Link('d', 0, 'a', 0, 'alpha', -pi/2,'sym');%定义连杆 L2 = Link('d', 'd2', 'a', 0, 'alpha', pi/2,'sym'); L3 = Link('theta', 0, 'a', 0, 'alpha', 0,'sym'); L4 = Link('d', 0, 'a', 0, 'alpha', -pi/2,'sym'); L5 = Link('d', 0, 'a', 0, 'alpha', pi/2,'sym'); L6 = Link('d', 'd6', 'a', 0, 'alpha', 0,'sym');

bot = SerialLink([L1 L2 L3 L4 L5 L6]);%连接连杆 syms theta1 theta2 d3 theta4 theta5 theta6;

forward_kinematics=bot.fkine([theta1 theta2 d3 theta4 theta5 theta6])%前向运动学 Stanford arm的运动学逆解:

clear; clc; clear L

% th d a alpha

L(1) = Link([ 0 0 0 -pi/2 0]);%定义连杆 L(2) = Link([ 0 1 0 pi/2 0]); L(3) = Link([ 0 0 0 0 1]); L(4) = Link([ 0 0 0 -pi/2 0]); L(5) = Link([ 0 0 0 pi/2 0]); L(6) = Link([ 0 1 0 0 0]);

bot = SerialLink(L, 'name', 'Stanford arm');%连接连杆

T=transl(1,2,3)*trotz(60,'deg')*troty(30,'deg')*trotz(90,'deg') inverse_kinematics=bot.ikine(T,'pinv');%逆向运动学 theta1=inverse_kinematics(1); theta2=inverse_kinematics(2); d3=inverse_kinematics(3); theta4=inverse_kinematics(4); theta5=inverse_kinematics(5); theta6=inverse_kinematics(6);

forward_kinematics=bot.fkine([theta1 theta2 d3 theta4 theta5 theta6])%前向运动学,验证结果的准确性.

%求解结果为T与forward_kinematics一致。正确。 求解Stanford arm在世界坐标系描述的雅克比矩阵 clear; clc; clear L

% th d a alpha

L(1) = Link([ 0 0 0 -pi/2 0]);%定义连杆 L(2) = Link([ 0 1 0 pi/2 0]); L(3) = Link([ 0 0 0 0 1]); L(4) = Link([ 0 0 0 -pi/2 0]); L(5) = Link([ 0 0 0 pi/2 0]); L(6) = Link([ 0 1 0 0 0]);

bot = SerialLink(L, 'name', 'Stanford arm');%连接连杆 syms theta1 theta2 d3 theta4 theta5 theta6;

J0=vpa(bot.jacob0([theta1 theta2 d3 theta4 theta5 theta6]),4) 求平面二自由度机器人在世界坐标系描述的雅克比矩阵

D-H参数表:

clear; clc; clear L

L(1) = Link('d',0,'a','a1','alpha',0,'sym');%定义连杆 L(2) = Link('d',0,'a','a2','alpha',0,'sym');

bot = SerialLink(L, 'name', 'Planar 2-dof robot');%连接连杆 syms theta1 theta2;

J0=bot.jacob0([theta1 theta2]); J0=simplify(J0) 求得:

J0 =

[ - a2*sin(theta1 + theta2) - a1*sin(theta1), -a2*sin(theta1 + theta2)] [ a2*cos(theta1 + theta2) + a1*cos(theta1), a2*cos(theta1 + theta2)]

[ 0, 0] [ 0, 0] [ 0, 0] [ 1, 1]


Matlab Robotic Toolbox工具箱学习笔记(3).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:齐鲁名校教科研协作体2016届高三第三次调研文综政治

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: