笔记之旋转矩阵Rotation Matrix《机器人学-林沛群》

摘要

image


名词解释

frame 坐标系
orthogonal 正交
DOF 自由度
commutable 可交换的


功能一

描述一个frame{B}相对于另一个frame{A}的姿态

定义

\[{^A_B}R =\begin{bmatrix} &| &| &|\\ &{^A}{\hat X_B} &{^A}{\hat Y_B} &{^A}{\hat Z_B}\\ &| &| &|\\ \end{bmatrix} \]

特性

  • \({^A_B}R\)\({^B_A}R\),两者互为转置。
    证明:

\[\begin{align} {^A_B}R &=\begin{bmatrix} &| &| &|\\ &{^A}{\hat X_B} &{^A}{\hat Y_B} &{^A}{\hat Z_B}\\ &| &| &|\\ \end{bmatrix}\\ &=\begin{bmatrix} {\hat X_B}\cdot{\hat X_A} &{\hat Y_B}\cdot{\hat X_A} &{\hat Z_B}\cdot{\hat X_A} \\ {\hat X_B}\cdot{\hat Y_A} &{\hat Y_B}\cdot{\hat Y_A} &{\hat Z_B}\cdot{\hat Y_A} \\ {\hat X_B}\cdot{\hat Z_A} &{\hat Y_B}\cdot{\hat Z_A} &{\hat Z_B}\cdot{\hat Z_A} \\ \end{bmatrix}\\ &=\begin{bmatrix} - {^B}{\hat X_A}^T - \\ - {^B}{\hat Y_A}^T - \\ - {^B}{\hat Z_A}^T - \end{bmatrix}\\ &=\begin{bmatrix} | &| &|\\ {^B}{\hat X_A} &{^B}{\hat Y_A} &{^B}{\hat Z_A}\\ | &| &|\\ \end{bmatrix}^T\\ &={^B_A}R^T \end{align} \]

  • \({^A_B}R\)的逆矩阵就是\({^B_A}R\),说明\({^A_B}R\)是3x3 orthogonal matrix,逆矩阵就是原矩阵的转置(隐含的一个结果就是一定有逆矩阵,因为任意矩阵都有矩阵的转置)
    证明:

\[\begin{align} {^A_B}R^T {^A_B}R &=\begin{bmatrix} - {^A}{\hat X_B}^T - \\ - {^A}{\hat Y_B}^T - \\ - {^A}{\hat Z_B}^T - \end{bmatrix} \begin{bmatrix} | &| &|\\ {^A}{\hat X_B} &{^A}{\hat Y_B} &{^A}{\hat Z_B}\\ | &| &| \end{bmatrix}\\ &= \begin{bmatrix} 1 &0 &0\\ 0 &1 &0\\ 0 &0 &1 \end{bmatrix}\\ &=I^3 \end{align} \]

\[{^A_B}R^{-1}={^A_B}R^T \]

  • 每个column都是一个方向向量,隐含的条件为三个column都是单位向量(每个column的三个值的平方和开根号都是1),并且三个column两两互相垂直(两两的内积都是0)。所以,每个column都是单位向量,为3个条件;每个column两两垂直,为3个条件。即,这个矩阵有9个数字,却已经包含6个条件,只剩下三个参数(自由度)可以自由选择(与空间中的刚体具有三个自由度是符合的)。
    callback:平面上的刚体只有两个自由度,空间中的刚体有三个自由度。

功能二

将向量P由一个frame{A}的表达转换到另一个和frame{A}仅有相对转动的frame{B}来表达

定义

\[{^A}P={^A_B}R {^B}P \]

推导

\[{^A}P={^A}P_x \hat X_A+{^A}P_y \hat Y_A+{^A}P_z \hat Z_A \]

\[{^B}P={^B}P_x \hat X_B+{^B}P_y \hat Y_B+{^B}P_z \hat Z_B \]

\[{^A}P_x={^B}P \cdot \hat X_A =\hat X_A \hat X_B {^B}P_x+\hat X_A \hat Y_B {^B}P_y+\hat X_A \hat Z_B {^B}P_z \]

\[{^A}P_x=\hat X_A \hat X_B {^B}P_x+\hat X_A \hat Y_B {^B}P_y+\hat X_A \hat Z_B {^B}P_z \]

\[{^A}P_y=\hat Y_A \hat X_B {^B}P_x+\hat Y_A \hat Y_B {^B}P_y+\hat Y_A \hat Z_B {^B}P_z \]

\[{^A}P_z=\hat Z_A \hat X_B {^B}P_x+\hat Z_A \hat Y_B {^B}P_y+\hat Z_A \hat Z_B {^B}P_z \]

\[{^A} \begin{bmatrix} P_x\\P_y\\P_z \end{bmatrix}= \begin{bmatrix} \hat X_A \hat X_B &\hat X_A \hat Y_B &\hat X_A \hat Z_B \\ \hat Y_A \hat X_B &\hat Y_A \hat Y_B &\hat Y_A \hat Z_B \\ \hat Z_A \hat X_B &\hat Z_A \hat Y_B &\hat Z_A \hat Z_B \\ \end{bmatrix} {^B} \begin{bmatrix} P_x\\P_y\\P_z \end{bmatrix} \]

\[{^A}P ={^A_B}R {^B}P\]


功能三

将向量P在一个frame中进行转动,成为向量P'
(约定:从旋转轴的上方往下看,逆时针旋转为正)

定义

\[{^A}P'=R(\theta)^A P \]

公式

imageimage
image
旋转轴和旋转角度定下来,那么旋转矩阵里的9个数字也定下来了。


空间旋转

Question

我们已经知道了围绕一个自由度旋转的Rotation matrix,那么如何找到任意的空间中的旋转对应的Rotation matrix?

Answer

因为空间中的旋转是3 DOFs,Rotation matrix本身也是3 DOFs,所以一个任意的空间中的旋转可以拆解成3次旋转。(大问题拆解成一个个子问题)

!Note

  • Rotation不是commutable,所以多次旋转的先后顺序需要明确定义
  • 旋转轴也需要明确定义,是对“固定不动”的转轴(固定坐标系的转轴)旋转?(Fixed angles),或是对“转动的frame当下所在”的转轴(物体坐标系的转轴)旋转?(Euler angles)

Fixed angles

image

image

posted @ 2026-03-07 19:53  BambooBear  阅读(1)  评论(0)    收藏  举报