Question
Write a Matlab function theta = ikinelbow(a2,d1,d4,d6,T,LR,UD,NF) that computes the inverse kinematics of the elbow manipulator, given a desired location of the endpoint frame T,
Write a Matlab function theta = ikinelbow(a2,d1,d4,d6,T,LR,UD,NF) that computes the inverse kinematics of the elbow manipulator, given a desired location of the endpoint frame T, which is frame 6 for the DH parameters below. The non-zero DH length parameters are passed to the function individually; otherwise, assume the skew angles in the table. LR chooses lefty (LR=1) or righty (LR=0), while UD chooses elbow up (UD=1) or elbow down (UD=0). No flip (NF=0) means the joint 5 angle is in quadrants 1 or 4, while flip (NF=1) specifies quadrants 2 or 3. Make sure to handle exceptional cases, such as a desired position that is outside of the workspace.
i ai di i
1 0 d1 /2
2 a2 0 0
3 0 0 /2
4 0 d4 /2
5 0 0 /2
6 0 d6 0
Use your previously generated fkine function to artificially generate poses, then run ikinelbow to retrieve the original joint angles.
function T = linktrans(a,d,alpha,theta)
T = [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];
Previous codes:
fkine =
function T = fkine(a,d,alpha,theta)
Ttemp = cell(1,length(a));
Ttemp{1, length(a)} =[];
T = linktrans(a(1),d(1),alpha(1),theta(1));
for k = 2:length(a)
Ttemp= linktrans(a(k),d(k),alpha(k),theta(k));
T = T * Ttemp;
end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started