- ABB工业机器人进阶编程与应用
- 陈瞭 肖辉编著
- 660字
- 2022-08-16 16:20:22
1.1.1 空间位姿的定义
对于坐标系A空间中的一个点的位置,可以表示为AP(Px,Py,Pz),如图1-4所示。用矩阵形式可以如下表示:

对于空间同一个位置,其可以有不同的姿态(方向)。而对于姿态(方向)的表示,可以在该点处构建一个坐标系B(见图1-5)。新坐标系B的X轴方向使用该轴在原有坐标系A3个方向的投影表示。为了方便表示,选用单位向量。
新坐标系B的Y轴和Z轴同理表示。旋转姿态可由下述矩阵表示,且式(1-2)称为旋转矩阵:


图1-4 空间点P的位置

图1-5 空间点P的姿态表示
将位置和姿态统称为位姿(位置和姿态)。空间中一个点的位姿可以用矩阵表示(为了矩阵齐次化,构建4×4的矩阵)。式(1-3)称为位姿矩阵或者齐次变换矩阵:

对于空间姿态,也可通过欧拉角表示(旋转顺序为Z、Y、X),即坐标系先绕原有坐标系的Z轴旋转α度,再绕新的坐标系的Y轴旋转β度,最后绕新的坐标系的X轴旋转γ度,如图1-6所示。

图1-6 Z-Y-X欧拉角
注:空间的旋转不满足交换律,不同的旋转顺序会导致不同的结果。
根据式(1-2)所示旋转矩阵的定义,结合图1-6的解释,可以整理得到基于Z-Y-X欧拉角的旋转矩阵如下:

式(1-4)中,cα=cosα,sα=sinα;cβ=cosβ,sβ=sinβ;cγ=cosγ,sγ=sinγ。整理式(1-4)后,可以得到旋转矩阵:

对于式(1-2)所示的旋转矩阵,还可以采用更简单的表达形式。四元数是一种描述此旋转矩阵更为简洁的方式。根据旋转矩阵的各元素,计算四元数。
令,则:


四元数不可直接做加减运算,且四元数的平方和须为1。
ABB工业机器人的pose数据采用空间位置pos(x,y,z)和四元数orient(q1,q2,q3,q4)来表示一个点的位姿(位置与姿态)。