本文主要是介绍【机器人学】-位姿描述和旋转变换(2),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
机器人学基础-旋转变换
空间旋转矩阵中有九个元素,但是这九个元素满足六个约束方程,只有三个独立变量
ABX = [ AXB AYB AYB ] = [ R 11 R 12 R 13 R 21 R 22 R 23 R 31 R 32 R 33 ] \begin{bmatrix}R11 & R12 & R13 \\ R21 & R22&R23\\R31&R32&R33\\ \end{bmatrix} ⎣⎡R11R21R31R12R22R32R13R23R33⎦⎤;
其中每个元素满足:
AXB ⋅ \cdot ⋅ AXB = AYB ⋅ \cdot ⋅ AYB = AZB ⋅ \cdot ⋅ AZB = 1;
AXB ⋅ \cdot ⋅ AYB = AYB ⋅ \cdot ⋅ AZB = AZB ⋅ \cdot ⋅ AXB = 0;
一、绕固定轴x-y-z旋转(RPY角)
1-1运动过程
RPY角对应的旋转矩阵,这种描述方法与操作轴末端执行器坐标系的规定方法类似,如下图;
坐标系的运动方式:{B}的开始方位与坐标系{A}重合,首先使得{B}绕XA旋转 γ \gamma γ 角,在绕YA 转 β \beta β 角,最后绕 ZA转 α \alpha α 角。(白->黄->红->蓝)
1-2旋转矩阵计算
根据坐标系的变换关系,坐标系{B}相对于{A}的旋转矩阵为:注意这里需要右乘,相对于基坐标系而言
ABRxyz( γ \gamma γ , β \beta β, α \alpha α ) = R(ZA, α \alpha α) ⋅ \cdot ⋅ R(YA, β \beta β) ⋅ \cdot ⋅ R(XA, γ \gamma γ)
= [ c α − s α 0 s α c α 0 0 0 1 ] \begin{bmatrix} c \alpha & -s\alpha& 0 \\ s\alpha & c\alpha&0\\0&0&1\\ \end{bmatrix} ⎣⎡cαsα0−sαcα0001⎦⎤ [ c β 0 s β 0 1 0 − s β 0 c β ] \begin{bmatrix} c \beta& 0& s\beta \\0& 1&0\\-s\beta&0&c\beta\\ \end{bmatrix} ⎣⎡cβ0−sβ010sβ0cβ⎦⎤ [ 1 0 0 0 c γ − s γ 0 s γ c γ ] \begin{bmatrix} 1 & 0& 0 \\ 0 & c\gamma&-s\gamma\\0&s\gamma&c\gamma\\ \end{bmatrix} ⎣⎡1000cγsγ0−sγcγ⎦⎤
= [ c α ⋅ c β c α ⋅ s β ⋅ s γ − s α ⋅ c γ c α ⋅ s β ⋅ c γ + s α ⋅ s γ s α ⋅ c β s α ⋅ s β ⋅ s γ + c α ⋅ c γ s α ⋅ s β ⋅ c γ − c α ⋅ s γ − s β c β ⋅ s γ c β ⋅ c γ ] \begin{bmatrix} c\alpha\cdot c\beta & c\alpha\cdot s\beta \cdot s \gamma - s\alpha\cdot c\gamma&c\alpha\cdot s\beta \cdot c \gamma+s\alpha\cdot s\gamma \\s\alpha\cdot c\beta & s\alpha\cdot s\beta \cdot s \gamma + c\alpha\cdot c\gamma&s\alpha\cdot s\beta \cdot c \gamma-c\alpha\cdot s\gamma \\-s\beta & c\beta \cdot s \gamma &c\beta \cdot c \gamma \\ \end{bmatrix} ⎣⎡cα⋅cβsα⋅cβ−sβcα⋅sβ⋅sγ−sα⋅cγsα⋅sβ⋅sγ+cα⋅cγcβ⋅sγcα⋅sβ⋅cγ+sα⋅sγsα⋅sβ⋅cγ−cα⋅sγcβ⋅cγ⎦⎤
1-3RPY角计算
已知旋转矩阵ABR,令该矩阵和矩阵ABRxyz对应元素相等可得
[ R 11 R 12 R 13 R 21 R 22 R 23 R 31 R 32 R 33 ] \begin{bmatrix}R11 & R12 & R13 \\ R21 & R22&R23\\R31&R32&R33\\ \end{bmatrix} ⎣⎡R11R21R31R12R22R32R13R23R33⎦⎤ = [ c α ⋅ c β c α ⋅ s β ⋅ s γ − s α ⋅ c γ c α ⋅ s β ⋅ c γ + s α ⋅ s γ s α ⋅ c β s α ⋅ s β ⋅ s γ + c α ⋅ c γ s α ⋅ s β ⋅ c γ − c α ⋅ s γ − s β c β ⋅ s γ c β ⋅ c γ ] \begin{bmatrix} c\alpha\cdot c\beta & c\alpha\cdot s\beta \cdot s \gamma - s\alpha\cdot c\gamma&c\alpha\cdot s\beta \cdot c \gamma+s\alpha\cdot s\gamma \\s\alpha\cdot c\beta & s\alpha\cdot s\beta \cdot s \gamma + c\alpha\cdot c\gamma&s\alpha\cdot s\beta \cdot c \gamma-c\alpha\cdot s\gamma \\-s\beta & c\beta \cdot s \gamma &c\beta \cdot c \gamma \\ \end{bmatrix} ⎣⎡cα⋅cβsα⋅cβ−sβcα⋅sβ⋅sγ−sα⋅cγsα⋅sβ⋅sγ+cα⋅cγcβ⋅sγcα⋅sβ⋅cγ+sα⋅sγsα⋅sβ⋅cγ−cα⋅sγcβ⋅cγ⎦⎤
通过比较可得cos β \beta β = ± R 1 1 2 + R 2 1 2 \pm\sqrt {R11^2+R21^2} ±R112+R212 ,通常我们规定 β ∈ [ − 90 , + 90 ] \beta\in[-90,+90] β∈[−90,+90],所以我们可以得到cos β \beta β = + R 1 1 2 + R 2 1 2 +\sqrt {R11^2+R21^2} +R112+R212。
如果cos β ≠ 0 \beta\neq0 β=0,则可以得到:
β = A tan 2 ( − R 31 , R 1 1 2 + R 2 1 2 ) \qquad\qquad\qquad\qquad\qquad\beta = A\tan2(-R31,\sqrt{R11^2+R21^2}) β=Atan2(−R31,R112+R212)
α = A tan 2 ( R 21 , R 11 ) \qquad\qquad\qquad\qquad\qquad\alpha = A\tan2(R21,R11) α=Atan2(R21,R11)
γ = A tan 2 ( R 32 , R 33 ) \qquad\qquad\qquad\qquad\qquad\gamma = A\tan2(R32,R33) γ=Atan2(R32,R33)
其中 A tan 2 ( y , x ) A\tan2(y,x) Atan2(y,x)成为四象限反正切函数
如果cos β = ± 90 \beta = \pm90 β=±90,则只能得到 α 和 γ \alpha和\gamma α和γ的和或差,通常选择 α = 0 \alpha = 0 α=0。
如果cos β = + 90 \beta = +90 β=+90,则可以得到:
β = 90 \qquad\qquad\qquad\qquad\qquad\beta = 90 β=90
α = 0 \qquad\qquad\qquad\qquad\qquad\alpha = 0 α=0
γ = A tan 2 ( R 12 , R 22 ) \qquad\qquad\qquad\qquad\qquad\gamma = A\tan2(R12,R22) γ=Atan2(R12,R22)
如果cos β = − 90 \beta = -90 β=−90,则可以得到:
β = − 90 \qquad\qquad\qquad\qquad\qquad\beta = -90 β=−90
α = 0 \qquad\qquad\qquad\qquad\qquad\alpha = 0 α=0
γ = − A tan 2 ( R 12 , R 22 ) \qquad\qquad\qquad\qquad\qquad\gamma = -A\tan2(R12,R22) γ=−Atan2(R12,R22)
二、绕相对于运动坐标系(ZYX欧拉角)
三、绕相对于运动坐标系(ZYZ欧拉角)
四、旋转变换通式
4-1坐标变换(正解)
{A’}是与K轴正交的坐标系,{B’}相对于{A’}相当于是绕z轴旋转
4-2 等效转轴和等效转角(逆解)
这篇关于【机器人学】-位姿描述和旋转变换(2)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!