使用Matlab的Robotics Toolbox进行运动学三维坐标位姿描述

实现移动和旋转代码:

%绘制坐标系的移动位姿
clc
clear
close('all')
T1=troty(0);
T2=transl(4,0,0)
T=T2*T1;
p1=[2;4;3;1];
Ap1=T*p1;
%%坐标系逆变换,坐标点正变换
Tr=inv(T);
Bp1=Tr*p1;
%%绘图
T0=transl(0,0,0);
trplot(T0,'frame','A','color','b');
axis([-5 5 -5 5 -5 5]);
hold on,
tranimate(T0,T,'frame','B','color','r')

其他相关函数说明:

平移和旋转矩阵:

        transl(x,y,z):(x,y,z)的平移

T1 = transl(0.5,0.0,0.0);   

trotx(theta) / troty(theta) / trotz(theta):绕x / y / z轴theta的旋转

R2 = trotx(pi/2)*troty(pi/2)*trotz(-pi/2);

rotx(theta) / roty(theta) / rotz(theta):绕x / y / z轴theta得到的旋转矩阵

R3 = rotx(30,"deg")*roty(30,"deg")*rotz(30,"deg");

注意:trotx和rotx默认都为弧度,trotx可直接与平移函数相乘,而rotx不可

绘制坐标变换:

trplot ( R ):绘制坐标系变换R

trplot(T0,'frame','A','color','b');

tranimate ( R ):绘制旋转动画R

tranimate(T0,T0*R2,'frame','B','color','r')

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

驽马匠人

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值