Error keeps appearing with h2e function used to obtain XYZ positions

2 ビュー (過去 30 日間)
Diego
Diego 2024 年 5 月 9 日
編集済み: Torsten 2024 年 5 月 10 日
Estaba diseñando un brazo robotico de 6 gdl (tomando de referencia un ABB IRB 1200) utilzando la libreria de Peter Corke, pero cuando intento utilizar la funcion h2e para obtener la posicion final del ultimo eslabon, esta me lanza el siguiente error.
I was designing a 6 DOF robotic arm (using an ABB IRB 1200 as reference) using Peter Corke's library, but when I try to use the h2e function to obtain the final position of the last link, it throws the following error.
Error using assert
LHS should be matrix with 3 rows
Error in * (line 357)
assert(numrows(a) == n-1, 'SMTB:RTBPose:badops', 'LHS should be matrix with %d rows', n-1);
Error in Cinematica_Robot_Manipulador_IRB1200 (line 52)
h2e(dh*[0 0 0 1]')'*100 % Posicion en X Y Z
El codigo que utilice fue uno que nos presento nuestro profesor, que es el siguiente:
The code I used was one that our teacher presented to us, which is the following:
close all
clc
%% Esta parte resuelve la cinematica directa del robot IRB 1200
syms q1 q2 q3 q4 q5 q6 % variables para los angulos de rotacion de las articulaciones
% Se declaran las logitudes de los eslabones
L1 = 399.1*1e-2;
L2 = 350*1e-2;
L3 = 175.5*1e-2;
L4 = 175.5*1e-2;
L5 = 82*1e-2;
% Se anota la cinematica directa segun D-H
A1 = trotz(q1)*transl(0,0,L1)*transl(0,0,0)*trotx(-pi/2);
A2 = trotz(q2-pi/2)*transl(0,0,0)*transl(L2,0,0)*trotx(0);
A3 = trotz(q3)*transl(0,0,0)*transl(L3,0,0)*trotx(-pi/2);
A4 = trotz(q4)*transl(0,0,L4)*transl(0,0,0)*trotx(pi/2);
A5 = trotz(q5)*transl(0,0,0)*transl(0,0,0)*trotx(-pi/2);
A6 = trotz(q6)*transl(0,0,L5)*transl(0,0,0)*trotx(0);
%% Se evalua la matriz de transmormacion total
T = A1*A2*A3*A4*A5*A6;
% Se le asignan valores a la articulaciones
q1 = 91.34 *pi/180;
q2 = 31.02 *pi/180;
q3 = -38.58 *pi/180;
q4 = -21.94 *pi/180;
q5 = 52.78 *pi/180;
q6 = -23.73 *pi/180;
%% Se declaran los eslabones y rotaciones conrtantes
dh1 = Link("d",L1,'a',0,'alpha',-pi/2);
dh2 = Link("d",0,'a',L2,'alpha',0);
dh3 = Link("d",0,'a',L3,'alpha',-pi/2);
dh4 = Link("d",L4,'a',0,'alpha',pi/2);
dh5 = Link("d",0,'a',0,'alpha',-pi/2);
dh6 = Link("d",L5,'a',0,'alpha',0);
%% Se ensamblan los eslabones.
rob = SerialLink ([dh1 dh2 dh3 dh4 dh5 dh6],'name','IRB 1200');
q = [q1 q2-pi/2 q3 q4 q5 q6];
% Se dibuja el robot en el espacio 3D
figure(1)
rob.plot(q,'workspace',[-15 15 -15 15 0 15],'view',[45 30]);
hold on
% Se obtiene la matriz de transformacion del modelo
dh = fkine(rob,q);
h2e(dh*[0 0 0 1]')'*100 % Posicion en X Y Z

回答 (0 件)

カテゴリ

Help Center および File ExchangeRobotics についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by