|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
matlab robotics toolbox的逆运动学求解ikine为题。: |9 g8 u2 W5 f2 k0 n$ x
代码如下:5 l* W: D: F/ ~6 P0 ]# Y
clear all;# q' Z3 I: ^$ I
clc;) W7 k2 K) V3 }& d8 I+ U* T+ G
startup_rvc;7 ^% l1 a6 n% H* Y
L(1) = Link([0,0.194,0.45,0,0]);
8 [& k4 Y6 V1 @L(1).qlim=([-130*pi/180,130*pi/180]);6 \7 r6 I" j# m6 j1 e7 l
L(2) = Link([0,0.072,0.35,0,0]);
$ o E- B& y9 i6 iL(2).qlim=([-5*pi/6,5*pi/6]);
$ R' G* f3 I. aL(3) = Link([0,0,0,0,1]);
) W/ L* G V) } v) ?L(3).qlim=[0,0.5];
6 f0 k( P- `7 W0 |L(4) = Link([0,0,0,0,0]);
- q# b) l. }1 j, E, LL(4).qlim=([-pi,pi]);
# V1 a H7 [ v9 nbot = SerialLink(L); %连接连杆, R5 F2 \" F4 G" g8 N7 @2 e% g
bot.name='SCARA'; Y7 x* p: b% I; B
bot.display() %显示D-H参数表
+ N9 A$ m9 T8 U$ e. v* ^, w% U4 A: b+ Sbot.teach(), R# g( ]" O( _1 |
, D5 Z+ M& C0 @, e! t4 w5 ST=[-0.2588 0.9659 0 0.1344;-0.9659 -0.2588 0 0.7278;0 0 1 0.366;0 0 0 1]
4 t* \6 P y+ B$ W: N9 g6 e! minverse_kinematics=bot.ikine(T) %逆向运动学. 这个逆解为啥就是不能求?????
* b% E3 J: W3 y' t3 g
8 \! s* s( X3 r/ H9 P! h5 e5 \9 y5 Q2 D
theta1=inverse_kinematics(1);
% |6 l5 P' g! K8 x! h) {- Itheta2=inverse_kinematics(2);
/ ]/ p. G- |3 R7 b9 {. R6 H2 Gd=inverse_kinematics(3);
1 z/ W e* L/ {9 B L3 ^, dtheta4=inverse_kinematics(4);
% f# } s0 L- C# Q kforward_kinematics=bot.fkine([theta1 theta2 d theta4])' [: k& F6 M$ ~: b5 Y& e s6 t
错误信息:: _! S% h8 ~! L/ k: [
Error using SerialLink/ikine (line 164)/ @. y" p. ~$ ^0 _! }: d* ^
Number of robot DOF must be >= the same number of 1s in the mask matrix; K9 R n4 v% H$ i y
0 w. x9 b+ D( W! T! ~Error in ikine (line 19)% X' f3 ^& r; @; P) U
inverse_kinematics=bot.ikine(T)
; {2 k5 A5 A; w$ c. \, ~/ W. b6 b4 T( w5 ]' _
' `4 q2 p6 |, J5 k4 c$ H j) L
4 a G; j" t5 ^" p7 [$ k想问下大家这个错误信息的自由度问题怎么解决?
& N# }' H& r2 m! K1 [' { |
|