# ros2_control发布的里程计速度高于实体机器人实际速度怎么解决

> 原文链接：https://robotics.hellobike.com/pitfalls/2025-05-22-robotics-se-114073
> 频道：pitfalls | 更新日期：2025-05-22 | 标签：auto, stackexchange, slam
> 核心摘要：用户使用ros2_control的差分驱动控制器时里程计速度高于实际，绕过PID控制将cmd_vel转PWM信号解决问题

# ros2_control发布的里程计速度高于实体机器人实际速度怎么解决

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[ros2_control publishes higher velocities to odom than the real robot goes at](https://robotics.stackexchange.com/questions/114073/ros2-control-publishes-higher-velocities-to-odom-than-the-real-robot-goes-at)（Robotics Stack Exchange #114073）

**状态**：已解决

## 问题

使用ros2_control的diff_drive_controller和slam_toolbox的online_async运行机器人时，ros2_control发布的里程计显示的移动、转动速度远高于实际值，调整轮间距、轮半径乘数及协方差均无法彻底解决该问题

## 环境

ROS2，使用diff_drive_controller控制器、slam_toolbox的online_async，硬件使用diffdrive_arduino插件、Arduino控制的开环电机

## 解决办法

1. 绕过PID控制
2. 直接将`cmd_vel`消息转换为原始PWM信号驱动电机

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

## 原始参考来源 (Sources)

- [Robotics Stack Exchange #114073：ros2_control publishes higher velocities to odom than the real robot goes at](https://robotics.stackexchange.com/questions/114073/ros2-control-publishes-higher-velocities-to-odom-than-the-real-robot-goes-at)