|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
matlab robotics toolbox的逆运动学求解ikine为题。
+ y" M, r( ~" D: c! d: I. Z1 h代码如下:
# m! d* }6 R7 x% ]1 zclear all;, S* T3 Z3 H/ }* L
clc;
@2 d/ ?' z! W& B: }' E Dstartup_rvc;
2 |- } V/ l, @- i" T+ HL(1) = Link([0,0.194,0.45,0,0]);( n7 Z: J5 I2 v
L(1).qlim=([-130*pi/180,130*pi/180]);6 v7 `6 P: l) _$ }
L(2) = Link([0,0.072,0.35,0,0]);
, \. _( ^/ E1 j I, hL(2).qlim=([-5*pi/6,5*pi/6]);
6 x# v) |5 p7 k$ Y3 ML(3) = Link([0,0,0,0,1]);
- N" q* |% Z, m/ ^9 c5 @L(3).qlim=[0,0.5];
, r( S K+ H5 u2 BL(4) = Link([0,0,0,0,0]);0 g/ Q* ?! m- z6 f2 @: ]7 w. U5 B& Z
L(4).qlim=([-pi,pi]);
* L4 K# o2 z' r6 l+ H F Y# y1 Fbot = SerialLink(L); %连接连杆" R" G. d2 E6 r$ V
bot.name='SCARA';
$ z8 `+ I: g! O, I! M! u0 lbot.display() %显示D-H参数表4 B4 R9 U* y7 _* P0 V; v
bot.teach()
1 I; @+ A( f* o" T# g8 V9 o& ? x
: M* w" j* l$ k' Q0 ST=[-0.2588 0.9659 0 0.1344;-0.9659 -0.2588 0 0.7278;0 0 1 0.366;0 0 0 1]
7 ~! V, {# l( K/ H9 T: S) ginverse_kinematics=bot.ikine(T) %逆向运动学. 这个逆解为啥就是不能求?????& N0 b# }& \% X
+ L% p8 k4 _# ^4 J
1 h @; l" l g8 F! \theta1=inverse_kinematics(1);
/ [7 D% k& d, }theta2=inverse_kinematics(2);
" e: o: a; e3 hd=inverse_kinematics(3);
) Z; w7 x0 M3 y3 z7 I* ]6 _) g" vtheta4=inverse_kinematics(4);# j1 g) {6 [5 [0 ~
forward_kinematics=bot.fkine([theta1 theta2 d theta4])
7 f9 e- G) c2 M# G% P错误信息:! X) O, [, z! J# y( s7 ~( ^
Error using SerialLink/ikine (line 164)' M7 e; @+ }7 g" R7 C, U
Number of robot DOF must be >= the same number of 1s in the mask matrix
' ^5 Y, L7 e% w) N' @$ j' c. p1 ^! _- W t) \, o" I* j) T* @
Error in ikine (line 19)
; W9 A& @% C2 Uinverse_kinematics=bot.ikine(T): [( {& F3 }! j& _. k0 s" e- `
, i0 _: m: {- u1 Y( D* \
5 C7 l. f4 K+ P5 x" P0 g! J
: w3 U# X6 E( A. z& D- Z; R求助大神!
' O4 t/ K4 r: H6 O, w. D |
|