⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inveuler.m

📁 The Robotics Toolbox provides many functions that are useful in robotics such as kinematics, dyn
💻 M
字号:


%% Author: epokh
%% Website: www.epokh.org/drupy
%% This software is under GPL

%%Inverse kinematics of the euler frame in closed form
%%input=euler matrix
%%output=rotation angles in degrees as positive values
%%for convetion the returned angles are all positive

function [fi1,theta,fi2]=invEuler(EulerMat)

nx=EulerMat(1,1);
ny=EulerMat(2,1);
nz=EulerMat(3,1);
ox=EulerMat(1,2);
oy=EulerMat(2,2);
oz=EulerMat(3,2);
ax=EulerMat(1,3);
ay=EulerMat(2,3);
az=EulerMat(3,3);
%%Arc tan return two angles here
fi1=atand(ay/ax);
theta=atand((ax*cosd(fi1)+ay*sind(fi1))/az);
if(theta<0)
    theta=theta+180;
end

fi2=atand((-nx*sind(fi1)+ny*cosd(fi1))/(-ox*sind(fi1)+oy*cosd(fi1)));
if(fi2<0)
    fi2=fi2+180;
end

end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -