# 如何将机体系滚转俯仰变换到局部固定系

> 原文链接：https://robotics.hellobike.com/pitfalls/2013-10-07-robotics-se-1925
> 频道：pitfalls | 更新日期：2013-10-07 | 标签：auto, stackexchange, mobile-robot, kinematics
> 核心摘要：通过引入只随偏航和位置变化的地面机器人坐标系，将滚转俯仰经偏航旋转到局部坐标系。

# 如何将机体系滚转俯仰变换到局部固定系

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[Performing the proper coordinate system transformation](https://robotics.stackexchange.com/questions/1925/performing-the-proper-coordinate-system-transformation)（Robotics Stack Exchange #1925）

**状态**：已解决

## 问题

系统启动时`body`与`local`对齐，估计器给出`x`、`y`、`roll`、`pitch`、`yaw`；其中`yaw`相对`local`的`z`轴，`roll`和`pitch`相对`body`，需要转换到固定`local`系。

## 环境

Linux / ROS 机器人软件与控制通用开发环境

## 解决办法

1. 引入新的参考系`R_p`，表示机器人在地平面上的位置；`R_p`随机器人在`X`、`Y`和`yaw`上移动，但不包含`roll`和`pitch`。
2. 将估计器给出的滚转`phi`和俯仰`theta`视为相对`R_p`的量。
3. 从`R_p`到局部固定系`L`时，仅绕`R_p`的`Z`轴旋转偏航角`psi`，使用`T_R^L`。
4. 计算`P_L = T_R^L * [phi, theta, 0, 0]^T`，得到相对初始化时建立的`local`系的姿态。

原问题作者：jdt141；采纳答案作者：jdt141。原内容依 CC BY-SA 4.0 授权，本页摘要同样依 CC BY-SA 4.0 授权。
:::

## 原始参考来源 (Sources)

- [Robotics Stack Exchange #1925：Performing the proper coordinate system transformation](https://robotics.stackexchange.com/questions/1925/performing-the-proper-coordinate-system-transformation)