|
本帖最后由 redmin 于 2022-3-29 10:57 编辑
- /****************************************************************
- 函数功能:数学模型
- 入口参数:末端执行器位姿态
- 返回 值:无
- **************************************************************/
- void Kinematic_Analysis(float x,float y,float Beta,float Alpha)
- {
- float m,n,k,a,b,c,theta1,theta2,theta3,s1ps2;
- m=l2*cos(Alpha)-x;
- n=l2*sin(Alpha)-y;
- k=(l1*l1-l0*l0-m*m-n*n)/2/l0;
- a=m*m+n*n;
- b=-2*n*k;
- c=k*k-m*m;
- theta1=(-b+sqrt(b*b-4*a*c))/2/a;
- theta1=asin(theta1)*180/PI;
- if(theta1>90)theta1=90;
- if(theta1<-90)theta1=-90;
- k=(l0*l0-l1*l1-m*m-n*n)/2/l1;
- a=m*m+n*n;
- b=-2*n*k;
- c=k*k-m*m;
- s1ps2=(-b-sqrt(b*b-4*a*c))/2/a;
- 4
- s1ps2=asin(s1ps2)*180/PI;
- if(s1ps2>90)theta2=90;
- if(s1ps2<-90)theta2=-90;
- theta2=s1ps2-theta1;
- if(theta2>90)theta2=90;
- if(theta2<-90)theta2=-90;
- theta3=Alpha*180/PI-theta1-theta2;
- if(theta3>90)theta3=90;
- if(theta3<-90)theta3=-90;
- Target1 = 750-(Beta)*Ratio;
- Target2 = 735+(theta1-90)*Ratio;
- Target3 = 717-(theta2)*Ratio;
- Target4 = 702-(theta3)*Ratio;;
- Target5 = 750;
- }
复制代码
Target1 = 750-(Beta)*Ratio;Target2 = 735+(theta1-90)*Ratio;
Target3 = 717-(theta2)*Ratio;
Target4 = 702-(theta3)*Ratio;;file:///C:\Users\17462\Documents\Tencent Files\1746285938\Image\C2C\$}6%K(BT79YZOM5NMMA%R6G.png
Target5 = 750
请问这几行代码什么意思?beta和ratio都是什么值?
|
|