|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
matlab robotics toolbox的逆运动学求解ikine为题。
# M ^& M0 Q8 V: g2 r% M代码如下:
0 ~; A8 U3 y* R F1 Y! ^. m, z8 Vclear all;
9 A1 b6 e1 o2 [clc; g, s8 y) R4 y& F2 |. D) O
startup_rvc;# ~% A- q6 y6 M9 W% z5 ]
L(1) = Link([0,0.194,0.45,0,0]);* X8 h% [3 R a+ c7 J" ?1 k
L(1).qlim=([-130*pi/180,130*pi/180]);
X. p' F# F; w, x0 qL(2) = Link([0,0.072,0.35,0,0]);
, S- n+ {/ X+ W2 a% t( lL(2).qlim=([-5*pi/6,5*pi/6]);$ h; w% j' c/ Y7 |7 h
L(3) = Link([0,0,0,0,1]);
1 p& S7 ^) j3 `2 B3 ^6 CL(3).qlim=[0,0.5]; - p! g2 O* r% Y# D, E* M4 B
L(4) = Link([0,0,0,0,0]);
- K" z3 G1 p& U: u# E. UL(4).qlim=([-pi,pi]);/ V1 |6 d; m9 S3 b/ i
bot = SerialLink(L); %连接连杆
% F- t# b7 [: R8 r; [+ mbot.name='SCARA';
3 v$ N5 {; G, D. }, kbot.display() %显示D-H参数表# R; H6 j' w0 k" @, }- m
bot.teach()
: K* Q/ } c) Q
) T0 F" r# G) hT=[-0.2588 0.9659 0 0.1344;-0.9659 -0.2588 0 0.7278;0 0 1 0.366;0 0 0 1]# B" K, f Y6 _
inverse_kinematics=bot.ikine(T) %逆向运动学. 这个逆解为啥就是不能求?????8 F) G# i* W7 ], l( d. `0 |1 ^
5 u% q3 H x$ i6 |0 c
2 @. ^9 M9 h4 @# o7 ttheta1=inverse_kinematics(1);9 [2 a( e: t3 j
theta2=inverse_kinematics(2);; b5 T5 a3 v8 @, e& y# u
d=inverse_kinematics(3);2 \. v) ]: s6 J. i( ]
theta4=inverse_kinematics(4); x! }; b. \% j. Q8 `+ f
forward_kinematics=bot.fkine([theta1 theta2 d theta4])
2 @) a8 V8 F* g$ G/ {3 ^错误信息:. f+ F7 U8 o/ W. t2 a( J( m. q- S+ W
Error using SerialLink/ikine (line 164)
8 K1 ]0 v \0 A- ^: H& dNumber of robot DOF must be >= the same number of 1s in the mask matrix7 H! M) F% d+ ]3 ~! w
8 o$ ]: G+ _. J4 z, W* B* AError in ikine (line 19)
$ L! w2 h9 M+ Binverse_kinematics=bot.ikine(T)) o, |# y7 s4 W7 f
+ D6 k; ?4 r5 x3 [# @* V% ?) X/ x
/ M5 W( U7 r1 j8 B% S; z _
6 B3 r1 \3 J+ |/ Y6 R4 E% o# B求助大神!
0 t( C0 E8 C* L! o# U$ T% d |
|