加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
screw2mat.m 776 Bytes
一键复制 编辑 原始数据 按行查看 历史
radica1113 提交于 2016-03-19 22:31 . first commit
function MAT=screw2mat(SC,a)
% SCREW2MAT maps twist SC and parameter a to matrix representation by means of exponential mapping.
% -SC is a 6X1 column vector
% -a is screw parameter
% -MAT is the exponential mapping of screw SC
sSC = size(SC);
if sSC == [1 6], SC = SC'; sSC = size(SC); end
% wrong format
if sSC(1) ~= 6
error('screw2mat:wrongsize %d rows in the SC array. It should be 6.',sSC(1));
end
rot=SC(1:3);
trans=SC(4:6);
%angular anti-symmetric matrix
A=sym(zeros(3,3));
A(1,2)=-rot(3);
A(1,3)=rot(2);
A(2,3)=-rot(1);
A(2,1)=-A(1,2);
A(3,1)=-A(1,3);
A(3,2)=-A(2,3);
A2=A*A;
%Rodrigues formula
eA=sym(eye(3))+sin(a)*A+(1-cos(a))*A2;
B=cross(rot,trans);
C=(sym(eye(3))-eA)*B;
D=a*rot*rot'*trans;
V=C+D;
MAT = sym(eye(4));
MAT(1:3,1:3)=eA;
MAT(1:3,4)=V;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化