-
Notifications
You must be signed in to change notification settings - Fork 0
/
SmallKatFTK.m
28 lines (23 loc) · 1.67 KB
/
SmallKatFTK.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function FTK = LegFTK(Angles, Leg, F)
%Forward Torque Kinematics
%Angles = [0,15,-15,15];
%Leg = [0,92,75,120];
q1 = (Angles(1));
q2 = (Angles(2));
q3 = (Angles(3));
q4 = (Angles(4));
a1 = Leg(1)*.1;
a2 = Leg(2)*.1;
a3 = Leg(3)*.1;
a4 = Leg(4)*.1;
%T = [0;.75;2;0;0;0];
%Tranpose of Jacobian Solved in SmallKat Forward Kinematics
J = [ 0, a3*cos(q2 + q3) + a2*cos(q2) + a4*cos(q2 + q3 + q4), a3*cos(q2 + q3) + a4*cos(q2 + q3 + q4), a4*cos(q2 + q3 + q4);...
cos(q1)*(a1 + a3*cos(q2 + q3) + a2*cos(q2) + a4*cos(q2 + q3 + q4)), -sin(q1)*(a3*sin(q2 + q3) + a2*sin(q2) + a4*sin(q2 + q3 + q4)), -sin(q1)*(a3*sin(q2 + q3) + a4*sin(q2 + q3 + q4)), -a4*sin(q2 + q3 + q4)*sin(q1);...
sin(q1)*(a1 + a3*cos(q2 + q3) + a2*cos(q2) + a4*cos(q2 + q3 + q4)), cos(q1)*(a3*sin(q2 + q3) + a2*sin(q2) + a4*sin(q2 + q3 + q4)), cos(q1)*(a3*sin(q2 + q3) + a4*sin(q2 + q3 + q4)), a4*sin(q2 + q3 + q4)*cos(q1);...
1, 0, 0, 0;...
0, 1, 1, 1;...
0, 0, 0, 0];
Jt = transpose(J);
FTK = (Jt*F);
end