1. 旋转矩阵

一般就用标准的3x3矩阵表示

创建方式也很简单

rotationMatrix = [0, -1, 0; 1, 0, 0; 0, 0, 1];

1.1. 旋转矩阵与旋转向量之间的转换

rotationVector = rotationMatrixToVector(rotationMatrix)rotationMatrix = rotationVectorToMatrix(rotationVector)

1.2. 旋转矩阵与四元数之间的转换

R = rotmat(Q, 'frame') % converts the scalar quaternion Q to a 3-by-3 matrix of the equivalent rotation matrix, suitable for frame rotation.             R = rotmat(Q, 'point') % converts the scalar quaternion Q to a 3-by-3 matrix of the equivalent rotation matrix, suitable for point rotation.  
% converts a rotation matrix, rotm, to the corresponding unit quaternion representation, quat. The input rotation matrix must be in the premultiply form for rotations.quat = rotm2quat(rotm) % converts a quaternion quat to an orthonormal rotation matrix, rotm. When using the rotation matrix, premultiply it with the coordinates to be rotated (as opposed to postmultiplying).rotm = quat2rotm(quat)

2. 方向余弦矩阵

一般就用标准的3x3矩阵表示

2. 四元数

2.1. 初始化

直接写成数组的形式即可

% 方法一
q = [w x y z]% 方法二
q = [w, x, y, z]
quat = quaternion() % creates an empty quaternion.quat = quaternion(A,B,C,D) % creates a quaternion array where the four quaternion parts are taken from the arrays A, B, C, and D. All the inputs must have the same size and be of the same data type.quat = quaternion(matrix) % creates an N-by-1 quaternion array from an N-by-4 matrix, where each column becomes one part of the quaternion.quat = quaternion(RV,'rotvec') % creates an N-by-1 quaternion array from an N-by-3 matrix of rotation vectors, RV.quat = quaternion(RM,'rotmat',PF) % creates an N-by-1 quaternion array from the 3-by-3-by-N array of rotation matrices, RM. PF can be either 'point' if the Euler angles represent point rotations or 'frame' for frame rotations.quat = quaternion(E,'euler',RS,PF) % creates an N-by-1 quaternion array from the N-by-3 matrix, E. Each row of E represents a set of Euler angles in radians. The angles in E are rotations about the axes in sequence RS.

2.2. 常见变换

模(Modulus):quatmod(p)    % 5.4772
范数(Norm):quatnorm(p)    0
单位化(Normalize):quatnormalize(p)    % 0.1826    0.3651    0.5477    0.7303
求逆(Inverse):quatinv(p)    % 0.0333   -0.0667   -0.1000   -0.1333
四元数除法:quatdivide(q,p)    % 0.6667         0   -0.6667   -0.3333
四元数乘法:quatmultiply(p,q)  % -12     6    24    12
共轭四元数:quatconj(p)      % 1    -2    -3    -4 

2.3. 转换为其它形式

转方向余弦矩阵

R1=quat2dcm(q1); %q1的第一位是实部

转欧拉角

quat2angle

3. 欧拉角

3.1. 欧拉角转旋转矩阵

一般情况下,欧拉角转旋转矩阵是这样定义的

3.2. 欧拉角转四元数

angle2quat

参考文献

欧拉角和旋转矩阵之间的转换 - 知乎

matlab中四元数转换为旋转矩阵_StrugglePeach的专栏-CSDN博客_matlab四元数转旋转矩阵

Matlab 四元数操作函数_豪怪_新浪博客

Matlab姿态表示相关推荐

  1. 四轴飞行器1.1 Matlab 姿态显示

    四轴飞行器1.1 Matlab 姿态显示 开始做四轴了,一步一步来,东西实在很多,比较杂.先做matlab上位机,主要用来做数据分析,等板子到了可以写飞控的程序了,从底层一层一层开始写..希望能好好的 ...

  2. 四足机器人|机器狗|仿生机器人|多足机器人|Adams仿真|Simulink仿真|基于CPG的四足机器人Simulink与Adams虚拟样机|源码可直接执行|绝对干货!需要资料及指导的可以联系我!

    四足机器人|机器狗|仿生机器人|多足机器人|基于CPG的四足机器人Simulink与Adams虚拟样机|源码可直接执行|绝对干货!需要资料及指导的可以联系我!QQ:1096474659 基于CPG的四 ...

  3. 四轴飞行器1.4 姿态解算和Matlab实时姿态显示

    四轴飞行器1.4 姿态解算和Matlab实时姿态显示 MPU6050数据读取出来后,经过一个星期的努力,姿态解算和在matlab上的实时显示姿态终于完成了. 1:完成matlab的串口,并且实时通过波 ...

  4. matlab与钻井平台,基于MATLAB环境下采用C8051F060实现钻井井眼姿态监测系统的设计...

    使用串口进行读写操作时,还需注意的一点就是对串口数据校验方式属性(Parity)的设置,如果该设置与下位机软件不匹配,将造成读写错误而又难以查找原因. 5.2 GUI界面中activx控件的使用 在M ...

  5. matlab检测串口数据帧头,MATLAB 串口读取姿态数据及GUI实时动态显示设计

    上一篇实现了Matlab 对串口数据的读取,数据可以读取并且保存到本地.本文主要设计GUI并且动态的显示曲线.可以更直观的观察实时的姿态数据和传感器数据. GUI设计效果: 姿态GUi.png 分别设 ...

  6. matlab求逆矩阵_MPU6050姿态解算2-欧拉角amp;旋转矩阵

    1 IMU姿态解算 IMU,即惯性测量单元,一般包含三轴陀螺仪与三轴加速度计.之前的文章 码农爱学习:MPU6050姿态解算方式1-DMP​zhuanlan.zhihu.com 已将对MPU6050这 ...

  7. (6.1)MATLAB机器人正、逆解中姿态求解的欧拉角的说明

    1.欧拉角的类型: 例程中MATLAB机器人工具箱中采用的是世界坐标系的欧拉角(先旋转的在右边).如下: 利用机器人工具箱的.teach()函数进行可是化时的欧拉角如下: 2.正解算法中的欧拉角: 在 ...

  8. imu matlab,IMU姿态解算matlab

    [实例简介] IMU姿态解算matlabIMU姿态解算matlabIMU姿态解算matlab [实例截图] [核心代码] GaitTrackingWithx-IMU └── Gait Tracking ...

  9. 六自由度机械臂正向运动学与姿态绘制with matlab

    如果不依赖机器人工具箱,希望自己通过作图显示机械臂某一时刻的工作姿态怎么来实现呢.首先我们知道原理是通过姿态的旋转变换以及平移变换来实现末端坐标的计算.计算完成后的将关节点连接起来便构成了机械臂在某一 ...

最新文章

  1. 《数学之美》第22章 自然语言处理的教父马库斯和他的优秀弟子们
  2. Windows Server 2012R2 DHCP故障转移(3)
  3. 日常生活中的法语积累2
  4. Spark SQL中 RDD 转换到 DataFrame (方法二)
  5. java拆分数据查相等_scikit learn:train_test_split,我可以确保在不同的数据集上进行相同的拆分...
  6. 英雄联盟更新防沉迷规则:未成年用户节假日每日限玩3小时
  7. IOS9 微信支付报 prepayid 获取失败 ErrorDomainSSL, -9802
  8. socket模块--TCP和UDP协议下的基础网络通话
  9. C++入门经典-例3.9-使用嵌套表达式判断一个数是否是3和5的整数倍
  10. block 在ARC和非ARC下的不同含义
  11. JavaWeb中实现验证码(ssh框架版)
  12. mysql安装包的下载
  13. Eclipse搭建Android开发环境并运行Android项目 (详细)
  14. mysql中角色权限表的设计_用户、角色、权限数据库设计
  15. android编程微博的发送,基于Android手机微博客户端的开发.doc
  16. linux img文件压缩及解压
  17. 介绍NPOI 的颜色卡、名称以及索引
  18. RANSAC Spline Fitting
  19. 阿里云 mysql 100_MySQL服务进程占用系统CPU达100%-阿里云开发者社区
  20. 新媒体运营岗位有哪些

热门文章

  1. View_01_LayoutInflater的原理、使用方法
  2. 如何设置 Linux 上 SSH 登录的 Email 提醒
  3. concat和concat_ws()区别及MySQL的几个实用字符串函数
  4. 怒刷web前端笔试面试题(一)
  5. jQuery EasyUI API 中文文档 - DataGrid 数据表格
  6. 2.5Gb/s混合集成光发射机
  7. 开机运行记事本怎么回事
  8. 区块链中的智能合约是什么?
  9. python字典{:4}_Python字典101:详细的视觉介绍
  10. redux logic_Redux-Logic简介