# 使用MoveIt2搭配Python和Gazebo时时间不匹配报错如何解决

> 原文链接：https://robotics.hellobike.com/pitfalls/2025-09-01-robotics-se-113233
> 频道：pitfalls | 更新日期：2025-09-01 | 标签：auto, stackexchange, moveit
> 核心摘要：MoveIt2和Gazebo联用时出现时间不匹配报错，通过配置use_sim_time参数可解决该问题

# 使用MoveIt2搭配Python和Gazebo时时间不匹配报错如何解决

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[Trying to use Moveit2 with Python and Gazebo but there appears to be a mismatch in the times they use, how to fix it?](https://robotics.stackexchange.com/questions/113233/trying-to-use-moveit2-with-python-and-gazebo-but-there-appears-to-be-a-mismatch)（Robotics Stack Exchange #113233）

**状态**：有绕过办法

## 问题

使用MoveIt2搭配Python和Gazebo时，报错提示10秒内未收到最新时间戳的机器人状态，请求的时间与最新接收的状态时间存在较大差异

## 环境

ROS 2 · MoveIt 2 · Gazebo / Ignition 仿真环境

## 解决办法

1. CLI启动节点的方式：执行命令 `ros2 run ＜package＞ ＜node＞ --ros-args -p use_sim_time:=True` 启动节点。
2. launch.py启动的方式：在Node配置中添加parameters=[{'use_sim_time': True}]参数

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

## 原始参考来源 (Sources)

- [Robotics Stack Exchange #113233：Trying to use Moveit2 with Python and Gazebo but there appears to be a mismatch in the times they use, how to fix it?](https://robotics.stackexchange.com/questions/113233/trying-to-use-moveit2-with-python-and-gazebo-but-there-appears-to-be-a-mismatch)