# roslaunch TurtleBot 仿真为何 xacro 返回 code 1？

> 原文链接：https://robotics.hellobike.com/pitfalls/2017-04-17-robotics-se-12145
> 频道：pitfalls | 更新日期：2017-04-17 | 标签：auto, stackexchange, ros, gazebo
> 核心摘要：运行 TurtleBot Gazebo 仿真时报 xacro.py 返回 code [1]，删除非默认 Python 后恢复正常。

# roslaunch TurtleBot 仿真为何 xacro 返回 code 1？

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[Roslaunch Gazebo Turtlebot Simulation Not Working](https://robotics.stackexchange.com/questions/12145/roslaunch-gazebo-turtlebot-simulation-not-working)（Robotics Stack Exchange #12145）

**状态**：已解决

## 问题

执行 `roslaunch turtlebot_gazebo turtlebot_world.launch` 时，处理 `kobuki.launch.xml` 报错：无法加载 `robot_description`，`xacro.py` 处理 URDF xacro 返回 `code [1]`。

## 环境

Gazebo / Ignition 仿真环境 · URDF / Xacro 机器人建模

## 解决办法

1. 检查系统是否在使用曾自行安装的非默认 Python。
2. 删除该非默认 Python，使 Ubuntu 使用默认 Python。
3. 重新运行 `roslaunch turtlebot_gazebo turtlebot_world.launch`。

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

## 原始参考来源 (Sources)

- [Robotics Stack Exchange #12145：Roslaunch Gazebo Turtlebot Simulation Not Working](https://robotics.stackexchange.com/questions/12145/roslaunch-gazebo-turtlebot-simulation-not-working)