Part 5-- reverse_solv_5.m
function [p_vec]=reverse_solv_5(x,y,theta) %provides solutions (p1,p2,p3) of Stewart platform inverse kinematics %problem, given x, y, and theta (for part 5) %platform sizes and parameters for the given problem L_1=3; L_2=3*sqrt(2); L_3=L_1; %p_1= UNKNOWN-- checking! %p_2= UNKNOWN-- checking! %p_3= UNKNOWN-- checking! x_1=5; x_2=0; y_2=6; gamma=pi*(1/4); %equation definitions from 1.38 A_2=L_3*cos(theta)-x_1; B_2=L_3*sin(theta); A_3=L_2*cos(theta+gamma)-x_2; B_3=L_2*sin(theta+gamma)-y_2; %solve p1, p2, p3 from 1.38 p_1=sqrt(x^2+y^2); p_2=sqrt((x+A_2)^2+(y+B_2)^2); p_3=sqrt((x+A_3)^2+(y+B_3)^2); %combine into single vector p_vec=[p_1 p_2 p_3]; end
Not enough input arguments. Error in reverse_solv_5 (line 25) A_2=L_3*cos(theta)-x_1;