matlab计算六轴机械臂DH正运动学

DH

根据DH法建立DH参数表格,根据表格输入参数到matlab程序,程序运行算出变换矩阵。

代码

function [outputArg1] = four_paramters2matrix(theta,d,a,alpha)
% 角度是弧度制
%UNTITLED 此处显示有关此函数的摘要
%   此处显示详细说明
outputArg1 = [cos(theta) -sin(theta)*cos(alpha) sin(theta)*sin(alpha) a*cos(theta);
    sin(theta) cos(theta)*cos(alpha) -cos(theta)*sin(alpha) a*sin(theta);
    0 sin(alpha) cos(alpha) d;
    0 0 0 1];
end
syms pi;
syms theta1;syms theta2;syms theta3;syms theta4;syms theta5;syms theta6;
syms d1;syms a2;syms a3;syms d6;
A1 = four_paramters2matrix(theta1,d1,0,pi/2);
A2 = four_paramters2matrix(theta2,0,a2,0);
A3 = four_paramters2matrix(theta3,0,a3,0);
A4 = four_paramters2matrix(theta4,0,0,-pi/2);
A5 = four_paramters2matrix(theta5,0,0,-pi/2);
A6 = four_paramters2matrix(theta6,d6,0,0);
result = A1*A2*A3*A4*A5*A6;
disp(result);

第一个是函数代码,第二个是主函数,根据自己的参数改一下主函数即可。

结果

附上一张输出结果样例
在这里插入图片描述
4x4的矩阵,结果很长.

  • 4
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

千里飞刀客

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值