# 仅用加速度计和陀螺仪无法估计绝对偏航角

> 原文链接：https://robotics.hellobike.com/pitfalls/2015-03-30-robotics-se-4677
> 频道：pitfalls | 更新日期：2015-03-30 | 标签：auto, stackexchange, sensors, quadcopter, kalman-filter, imu
> 核心摘要：用yaw = atan2(Ax,Ay)估计偏航无效；需用磁力计、GPS等提供航向更新并做校正融合。

# 仅用加速度计和陀螺仪无法估计绝对偏航角

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[How to estimate yaw angle from tri-axis accelerometer and gyroscope](https://robotics.stackexchange.com/questions/4677/how-to-estimate-yaw-angle-from-tri-axis-accelerometer-and-gyroscope)（Robotics Stack Exchange #4677）

**状态**：已解决

## 问题

提问者用三轴加速度计和陀螺仪估计姿态，`roll`和`pitch`较准确，但用`yaw = atan2(Ax,Ay) * RAD_TO_DEG`估计偏航角不起作用。

## 环境

状态估计 / EKF 滤波器

## 解决办法

1. 不要期望陀螺仪给出绝对`yaw`，它只能提供偏航角变化率，积分会逐渐漂移。
2. 增加可周期性提供实际航向的传感器，如磁力计/罗盘、GPS、双GPS或其他航向获取方法。
3. 将该航向输入校正算法，例如`Sebastian Madgwick's filter`，用于修正偏航估计。

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

## 原始参考来源 (Sources)

- [Robotics Stack Exchange #4677：How to estimate yaw angle from tri-axis accelerometer and gyroscope](https://robotics.stackexchange.com/questions/4677/how-to-estimate-yaw-angle-from-tri-axis-accelerometer-and-gyroscope)