失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > Matlab人形机器人建模与仿真

Matlab人形机器人建模与仿真

时间:2020-03-08 14:26:44

相关推荐

Matlab人形机器人建模与仿真

DH 参数 DH 参数

Denavit-Hartenberg (DH) 提供各种修改版和标准版。 修改后的约定中的连杆和关节参数如下图所示:

DH参数根据下表确定。

The algorithm of the modified DH convention:

两个附加参数是 Sigma 和 Offset。

链接 [THETA, D ,A ,ALPHA ,SIGMA ,OFFSET]

OFFSET 是用户关节角度矢量和真实运动学解之间的恒定位移。 SIGMA=0 表示旋转接头,1 表示棱柱接头。

结构体

结果

MATLAB 教学工具箱中的最终模型

Denavit-Hartenberg 参数

平台

left arm

right arm

left leg

right leg

​我的中文水平不是很好,所以我用翻译软件来写这篇文章。 希望它派上用场。

My chinese level is not that good, so I used a translate app to write this article. Hope it comes handy.

Code:GitHub - MikeHarris-AHAM/Humanoid-Kinematics-Simulation: Humanoid Robot Kinematics Simulation Using MATLAB Teach Toolbox.

%% ------------------------------------------------------------------------% Kinematic Model of Humanoid Robot%% Mike%% Date: 15/7/%%% ------------------------------- Init Env -------------------------------clear;close all;clc;pi = 3.14;%% Link [THETA D A ALPHA SIGMA OFFSET]%% OFFSET is a constant displacement between the user joint angle vector % and the true kinematic solution.%% SIGMA SIGMA=0 for a revolute and 1 for a prismatic joint.%% ------------------------------ platform -------------------------------platform=SerialLink([0 0 0 0],'name','platform','modified');platform.base=[1 0 0 0;0 1 0 0;0 0 1 0;0 0 0 1;]; platform.qlim = [0,0]; %Platform%% ------------------------------ Right Arm ------------------------------- RA(1)=Link([0 0.49077 0 0 00],'modified'); RA(2)=Link([0 0.2830 pi/20-pi/2],'modified');RA(3)=Link([0 0 0 pi/200],'modified');RA(4)=Link([0 0 0.287pi/200],'modified');RA(5)=Link([0 0 0.287pi/2 00],'modified');Humanoid_Robot_RA=SerialLink(RA,'name','RIGHTARM');RA(1).qlim = [0,0]; % Base for Upper bodyRA(2).qlim = [deg2rad(-50),deg2rad(50)]; % Shoulder PitchRA(3).qlim = [0,deg2rad(60)]; % Shoulder RollRA(4).qlim = [0,deg2rad(140)]; % Elbow PitchRA(5).qlim = [0,0];%end-effector%% -------------------------- Assembly Right Arm --------------------------pRA=SerialLink([platform,Humanoid_Robot_RA],'name','RA'); view(3)hold ongrid onlen_RA = length(RA);init_RA = [];for i=1:len_RA+1init_RA(i) = 0;endpRA.plot([init_RA],'scale',.5)% pRA.teachhold on %% ------------------------------ Left Arm -------------------------------- LA(1)=Link([0 0.49077 0 0 00],'modified'); LA(2)=Link([0 -0.2830 pi/20-pi/2],'modified');LA(3)=Link([0 0 0 pi/200],'modified');LA(4)=Link([0 0 0.287pi/200],'modified');LA(5)=Link([0 0 0.287pi/2 00],'modified');Humanoid_Robot_LA=SerialLink(LA,'name','LEFTARM');LA(1).qlim = [0,0]; % Base for Upper bodyLA(2).qlim = [deg2rad(-50),deg2rad(50)]; % Shoulder PitchLA(3).qlim = [0,deg2rad(60)]; % Shoulder RollLA(4).qlim = [0,deg2rad(140)]; % Elbow PitchLA(5).qlim = [0,0]; %end-effector%% -------------------------- Assembly Left Arm ---------------------------pLA=SerialLink([platform,Humanoid_Robot_LA],'name','LA'); view(3)hold ongrid onaxis([-1, 1, -1, 1, -1, 1]*0.9)len_LA = length(LA);init_LA = [];for i=1:len_LA+1init_LA(i) = 0;endpLA.plot([init_LA],'scale',.5)% pLA.teachhold on%% ------------------------------ Left Leg -------------------------------- LL(1)=Link([0 -0.120 0 pi/2 00 ],'modified'); LL(2)=Link([0 0 0 pi/2 0 -pi/2 ],'modified');LL(3)=Link([0 0 0 -pi/2 0 -pi/2 ],'modified');LL(4)=Link([0 0 0.42 pi/2 0 0 ],'modified');LL(5)=Link([0 0 0.42 0 00],'modified');LL(6)=Link([0 0.0772 0 -pi/2 0 0],'modified');LL(7)=Link([0 0 00 0 0],'modified');Humanoid_Robot_LL=SerialLink(LL,'name','LEFTLEG');LL(1).qlim = [deg2rad(-50),deg2rad(50)]; %Hip Pitch -50 to 50LL(2).qlim = [deg2rad(-50.15923567),deg2rad(50.15923567)]; %Hip yaw -50.15923567 to 50.15923567LL(3).qlim = [deg2rad(-5),deg2rad(5)]; %Hip roll -5 to 5LL(4).qlim = [0,deg2rad(90)]; %knee 0 to 90LL(5).qlim = [deg2rad(-45),deg2rad(45)]; %Ankle Pitch -45 to 45LL(6).qlim = [deg2rad(-20),deg2rad(20)]; %Ankle Roll -20 to 20LL(7).qlim = [0,0]; %end-effector%% -------------------------- Assembly Left Arm ---------------------------pLL=SerialLink([platform,Humanoid_Robot_LL],'name','LL'); view(3)hold ongrid onaxis([-1, 1, -1, 1, -1, 1]*0.9)len_LL = length(LL);init_LL = [];for i=1:len_LL+1init_LL(i) = 0;endpLL.plot([init_LL],'scale',.5)pLL.teachhold on%% ------------------------------ Right Leg -------------------------------- RL(1)=Link([0 0.120 0 pi/2 00 ],'modified'); RL(2)=Link([0 0 0 pi/2 0 -pi/2 ],'modified');RL(3)=Link([0 0 0 -pi/2 0 -pi/2 ],'modified');RL(4)=Link([0 0 0.42 pi/2 0 0 ],'modified');RL(5)=Link([0 0 0.42 0 00],'modified');RL(6)=Link([0 0.0772 0 -pi/2 0 0],'modified');RL(7)=Link([0 0 0 0 0 0],'modified');Humanoid_Robot_RL=SerialLink(RL,'name','RightLEG');RL(1).qlim = [deg2rad(-50),deg2rad(50)]; %Hip Pitch -50 to 50RL(2).qlim = [deg2rad(-50.15923567),deg2rad(50.15923567)]; %Hip yaw -50.15923567 to 50.15923567RL(3).qlim = [deg2rad(-5),deg2rad(5)]; %Hip roll -5 to 5RL(4).qlim = [0,deg2rad(90)]; %knee 0 to 90RL(5).qlim = [deg2rad(-45),deg2rad(45)]; %Ankle Pitch -45 to 45RL(6).qlim = [deg2rad(-20),deg2rad(20)]; %Ankle Roll -20 to 20RL(7).qlim = [0,0]; %end-effector%% -------------------------- Assembly Right Arm --------------------------pRL=SerialLink([platform,Humanoid_Robot_RL],'name','RL'); view(3)hold ongrid onaxis([-1, 1, -1, 1, -1, 1]*0.9)len_RL = length(RL);init_RL = [];for i=1:len_RL+1init_RL(i) = 0;endpRL.plot([init_RL],'scale',.5)pRL.teachhold on%% -------------------------------- Jacobian ------------------------------Q = zeros(7,len_LL);Jacob_LL = pLL.jacobe(Q);Q = zeros(7,len_RL);Jacob_RL = pRL.jacobe(Q);Q = zeros(7,len_LA);Jacob_LA = pLA.jacobe(Q);Q = zeros(7,len_RA);Jacob_RA = pRA.jacobe(Q);%% -------------------------------------------------------------------------

如果觉得《Matlab人形机器人建模与仿真》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。